Browse Source

Merge pull request #6644 from nocodb/nc-refactor/api-v2

Refactor/api v2
pull/6648/head
Pranav C 1 year ago committed by GitHub
parent
commit
c301c2aacd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue
  2. 10
      packages/nc-gui/components/dlg/AirtableImport.vue
  3. 2
      packages/nc-gui/components/general/HelpAndSupport.vue
  4. 2
      packages/nc-gui/components/smartsheet/ApiSnippet.vue
  5. 2
      packages/nc-gui/components/smartsheet/details/Api.vue
  6. 6
      packages/nocodb/src/controllers/api-docs/api-docs.controller.ts
  7. 6
      packages/nocodb/src/controllers/api-tokens.controller.ts
  8. 4
      packages/nocodb/src/controllers/attachments-secure.controller.ts
  9. 4
      packages/nocodb/src/controllers/attachments.controller.ts
  10. 12
      packages/nocodb/src/controllers/audits.controller.ts
  11. 12
      packages/nocodb/src/controllers/base-users.controller.ts
  12. 14
      packages/nocodb/src/controllers/bases.controller.ts
  13. 25
      packages/nocodb/src/controllers/bulk-data-alias.controller.ts
  14. 4
      packages/nocodb/src/controllers/caches.controller.ts
  15. 14
      packages/nocodb/src/controllers/columns.controller.ts
  16. 4
      packages/nocodb/src/controllers/data-alias-export.controller.ts
  17. 15
      packages/nocodb/src/controllers/data-alias-nested.controller.ts
  18. 20
      packages/nocodb/src/controllers/data-alias.controller.ts
  19. 16
      packages/nocodb/src/controllers/filters.controller.ts
  20. 2
      packages/nocodb/src/controllers/form-columns.controller.ts
  21. 6
      packages/nocodb/src/controllers/forms.controller.ts
  22. 6
      packages/nocodb/src/controllers/galleries.controller.ts
  23. 4
      packages/nocodb/src/controllers/grid-columns.controller.ts
  24. 4
      packages/nocodb/src/controllers/grids.controller.ts
  25. 14
      packages/nocodb/src/controllers/hooks.controller.ts
  26. 6
      packages/nocodb/src/controllers/kanbans.controller.ts
  27. 6
      packages/nocodb/src/controllers/maps.controller.ts
  28. 4
      packages/nocodb/src/controllers/meta-diffs.controller.ts
  29. 4
      packages/nocodb/src/controllers/model-visibilities.controller.ts
  30. 12
      packages/nocodb/src/controllers/plugins.controller.ts
  31. 4
      packages/nocodb/src/controllers/public-datas-export.controller.ts
  32. 14
      packages/nocodb/src/controllers/public-datas.controller.ts
  33. 4
      packages/nocodb/src/controllers/public-metas.controller.ts
  34. 8
      packages/nocodb/src/controllers/shared-bases.controller.ts
  35. 10
      packages/nocodb/src/controllers/sorts.controller.ts
  36. 6
      packages/nocodb/src/controllers/sources.controller.ts
  37. 2
      packages/nocodb/src/controllers/sql-views.controller.ts
  38. 12
      packages/nocodb/src/controllers/sync.controller.ts
  39. 16
      packages/nocodb/src/controllers/tables.controller.ts
  40. 6
      packages/nocodb/src/controllers/utils.controller.ts
  41. 6
      packages/nocodb/src/controllers/view-columns.controller.ts
  42. 18
      packages/nocodb/src/controllers/views.controller.ts
  43. 11
      packages/nocodb/src/middlewares/extract-ids/extract-ids.middleware.ts
  44. 4
      packages/nocodb/src/modules/jobs/jobs/at-import/at-import.controller.ts
  45. 4
      packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.controller.ts
  46. 4
      packages/nocodb/src/modules/jobs/jobs/meta-sync/meta-sync.controller.ts
  47. 4
      packages/nocodb/src/modules/jobs/jobs/source-create/source-create.controller.ts
  48. 2
      packages/nocodb/src/modules/jobs/jobs/source-delete/source-delete.controller.ts
  49. 20308
      packages/nocodb/src/schema/swagger-v2.json
  50. 218
      packages/nocodb/src/schema/swagger.json
  51. 31
      packages/nocodb/src/services/api-docs/swagger/templates/paths.ts
  52. 6
      packages/nocodb/tests/unit/factory/base.ts
  53. 4
      packages/nocodb/tests/unit/factory/column.ts
  54. 10
      packages/nocodb/tests/unit/factory/row.ts
  55. 2
      packages/nocodb/tests/unit/factory/table.ts
  56. 10
      packages/nocodb/tests/unit/factory/view.ts
  57. 16
      packages/nocodb/tests/unit/rest/tests/attachment.test.ts
  58. 50
      packages/nocodb/tests/unit/rest/tests/base.test.ts
  59. 4
      packages/nocodb/tests/unit/rest/tests/columnTypeSpecific.test.ts
  60. 4
      packages/nocodb/tests/unit/rest/tests/filter.test.ts
  61. 32
      packages/nocodb/tests/unit/rest/tests/groupby.test.ts
  62. 34
      packages/nocodb/tests/unit/rest/tests/org.test.ts
  63. 34
      packages/nocodb/tests/unit/rest/tests/table.test.ts
  64. 172
      packages/nocodb/tests/unit/rest/tests/tableRow.test.ts
  65. 66
      packages/nocodb/tests/unit/rest/tests/viewRow.test.ts
  66. 2
      tests/playwright/pages/Account/AppStore.ts
  67. 2
      tests/playwright/pages/Account/ChangePassword.ts
  68. 2
      tests/playwright/pages/Dashboard/BulkUpdate/index.ts
  69. 4
      tests/playwright/pages/Dashboard/ExpandedForm/index.ts
  70. 8
      tests/playwright/pages/Dashboard/Form/index.ts
  71. 4
      tests/playwright/pages/Dashboard/Grid/Column/index.ts
  72. 4
      tests/playwright/pages/Dashboard/Grid/index.ts
  73. 2
      tests/playwright/pages/Dashboard/Import/ImportTemplate.ts
  74. 2
      tests/playwright/pages/Dashboard/Settings/Miscellaneous.ts
  75. 2
      tests/playwright/pages/Dashboard/ShareProjectButton/index.ts
  76. 4
      tests/playwright/pages/Dashboard/Sidebar/index.ts
  77. 8
      tests/playwright/pages/Dashboard/TreeView.ts
  78. 2
      tests/playwright/pages/Dashboard/ViewSidebar/index.ts
  79. 2
      tests/playwright/pages/Dashboard/common/Cell/RatingCell.ts
  80. 2
      tests/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts
  81. 4
      tests/playwright/pages/Dashboard/common/Cell/index.ts
  82. 10
      tests/playwright/pages/Dashboard/common/Toolbar/Fields.ts
  83. 18
      tests/playwright/pages/Dashboard/common/Toolbar/Filter.ts
  84. 2
      tests/playwright/pages/Dashboard/common/Toolbar/Groupby.ts
  85. 6
      tests/playwright/pages/Dashboard/common/Toolbar/Sort.ts
  86. 12
      tests/playwright/pages/ProjectsPage/index.ts
  87. 6
      tests/playwright/pages/WorkspacePage/ContainerPage.ts
  88. 2
      tests/playwright/tests/db/features/swagger.spec.ts
  89. 4
      tests/playwright/tests/db/features/undo-redo.spec.ts
  90. 2
      tests/playwright/tests/db/general/groupCRUD.spec.ts

2
packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue

@ -514,7 +514,7 @@ const projectDelete = () => {
@click.stop=" @click.stop="
() => { () => {
$e('c:base:api-docs') $e('c:base:api-docs')
openLink(`/api/v1/meta/bases/${base.id}/swagger`, appInfo.ncSiteUrl) openLink(`/api/v1/db/meta/projects/${base.id}/swagger`, appInfo.ncSiteUrl)
} }
" "
> >

10
packages/nc-gui/components/dlg/AirtableImport.vue

@ -125,14 +125,14 @@ async function createOrUpdate() {
const { id, ...payload } = syncSource.value const { id, ...payload } = syncSource.value
if (id !== '') { if (id !== '') {
await $fetch(`/api/v1/meta/syncs/${id}`, { await $fetch(`/api/v1/db/meta/syncs/${id}`, {
baseURL, baseURL,
method: 'PATCH', method: 'PATCH',
headers: { 'xc-auth': $state.token.value as string }, headers: { 'xc-auth': $state.token.value as string },
body: payload, body: payload,
}) })
} else { } else {
syncSource.value = await $fetch(`/api/v1/meta/bases/${baseId}/syncs/${sourceId}`, { syncSource.value = await $fetch(`/api/v1/db/meta/projects/${baseId}/syncs/${sourceId}`, {
baseURL, baseURL,
method: 'POST', method: 'POST',
headers: { 'xc-auth': $state.token.value as string }, headers: { 'xc-auth': $state.token.value as string },
@ -184,7 +184,7 @@ async function listenForUpdates() {
} }
async function loadSyncSrc() { async function loadSyncSrc() {
const data: any = await $fetch(`/api/v1/meta/bases/${baseId}/syncs/${sourceId}`, { const data: any = await $fetch(`/api/v1/db/meta/projects/${baseId}/syncs/${sourceId}`, {
baseURL, baseURL,
method: 'GET', method: 'GET',
headers: { 'xc-auth': $state.token.value as string }, headers: { 'xc-auth': $state.token.value as string },
@ -226,7 +226,7 @@ async function loadSyncSrc() {
async function sync() { async function sync() {
try { try {
await $fetch(`/api/v1/meta/syncs/${syncSource.value.id}/trigger`, { await $fetch(`/api/v1/db/meta/syncs/${syncSource.value.id}/trigger`, {
baseURL, baseURL,
method: 'POST', method: 'POST',
headers: { 'xc-auth': $state.token.value as string }, headers: { 'xc-auth': $state.token.value as string },
@ -245,7 +245,7 @@ async function abort() {
"This is a highly experimental feature and only marks job as not started, please don't abort the job unless you are sure job is stuck.", "This is a highly experimental feature and only marks job as not started, please don't abort the job unless you are sure job is stuck.",
onOk: async () => { onOk: async () => {
try { try {
await $fetch(`/api/v1/meta/syncs/${syncSource.value.id}/abort`, { await $fetch(`/api/v1/db/meta/syncs/${syncSource.value.id}/abort`, {
baseURL, baseURL,
method: 'POST', method: 'POST',
headers: { 'xc-auth': $state.token.value as string }, headers: { 'xc-auth': $state.token.value as string },

2
packages/nc-gui/components/general/HelpAndSupport.vue

@ -10,7 +10,7 @@ const { base } = storeToRefs(useBase())
const route = useRoute() const route = useRoute()
const openSwaggerLink = () => { const openSwaggerLink = () => {
openLink(`./api/v1/meta/bases/${route.params.baseId}/swagger`, appInfo.value.ncSiteUrl) openLink(`./api/v1/db/meta/projects/${route.params.baseId}/swagger`, appInfo.value.ncSiteUrl)
} }
</script> </script>

2
packages/nc-gui/components/smartsheet/ApiSnippet.vue

@ -84,7 +84,7 @@ const selectedLangName = ref(langs[0].name)
const apiUrl = computed( const apiUrl = computed(
() => () =>
new URL( new URL(
`/api/v1/data/noco/${base.value.id}/${meta.value?.title}/views/${view.value?.title}`, `/api/v1/db/data/noco/${base.value.id}/${meta.value?.title}/views/${view.value?.title}`,
(appInfo.value && appInfo.value.ncSiteUrl) || '/', (appInfo.value && appInfo.value.ncSiteUrl) || '/',
).href, ).href,
) )

2
packages/nc-gui/components/smartsheet/details/Api.vue

@ -84,7 +84,7 @@ const selectedLangName = ref(langs[0].name)
const apiUrl = computed( const apiUrl = computed(
() => () =>
new URL( new URL(
`/api/v1/data/noco/${base.value?.id}/${meta.value?.title}/views/${view.value?.title}`, `/api/v1/db/data/noco/${base.value?.id}/${meta.value?.title}/views/${view.value?.title}`,
(appInfo.value && appInfo.value.ncSiteUrl) || '/', (appInfo.value && appInfo.value.ncSiteUrl) || '/',
).href, ).href,
) )

6
packages/nocodb/src/controllers/api-docs/api-docs.controller.ts

@ -20,7 +20,7 @@ export class ApiDocsController {
@Get([ @Get([
'/api/v1/db/meta/projects/:baseId/swagger.json', '/api/v1/db/meta/projects/:baseId/swagger.json',
'/api/v1/meta/bases/:baseId/swagger.json', '/api/v2/meta/bases/:baseId/swagger.json',
]) ])
@UseGuards(MetaApiLimiterGuard, GlobalGuard) @UseGuards(MetaApiLimiterGuard, GlobalGuard)
@Acl('swaggerJson') @Acl('swaggerJson')
@ -34,7 +34,7 @@ export class ApiDocsController {
} }
@Get([ @Get([
'/api/v1/meta/bases/:baseId/swagger', '/api/v2/meta/bases/:baseId/swagger',
'/api/v1/db/meta/projects/:baseId/swagger', '/api/v1/db/meta/projects/:baseId/swagger',
]) ])
@UseGuards(PublicApiLimiterGuard) @UseGuards(PublicApiLimiterGuard)
@ -45,7 +45,7 @@ export class ApiDocsController {
@UseGuards(PublicApiLimiterGuard) @UseGuards(PublicApiLimiterGuard)
@Get([ @Get([
'/api/v1/db/meta/projects/:baseId/redoc', '/api/v1/db/meta/projects/:baseId/redoc',
'/api/v1/meta/bases/:baseId/redoc', '/api/v2/meta/bases/:baseId/redoc',
]) ])
redocHtml(@Param('baseId') baseId: string, @Response() res) { redocHtml(@Param('baseId') baseId: string, @Response() res) {
res.send(getRedocHtml({ ncSiteUrl: process.env.NC_PUBLIC_URL || '' })); res.send(getRedocHtml({ ncSiteUrl: process.env.NC_PUBLIC_URL || '' }));

6
packages/nocodb/src/controllers/api-tokens.controller.ts

@ -22,7 +22,7 @@ export class ApiTokensController {
@Get([ @Get([
'/api/v1/db/meta/projects/:baseId/api-tokens', '/api/v1/db/meta/projects/:baseId/api-tokens',
'/api/v1/meta/bases/:baseId/api-tokens', '/api/v2/meta/bases/:baseId/api-tokens',
]) ])
@Acl('baseApiTokenList') @Acl('baseApiTokenList')
async apiTokenList(@Request() req) { async apiTokenList(@Request() req) {
@ -33,7 +33,7 @@ export class ApiTokensController {
@Post([ @Post([
'/api/v1/db/meta/projects/:baseId/api-tokens', '/api/v1/db/meta/projects/:baseId/api-tokens',
'/api/v1/meta/bases/:baseId/api-tokens', '/api/v2/meta/bases/:baseId/api-tokens',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('baseApiTokenCreate') @Acl('baseApiTokenCreate')
@ -46,7 +46,7 @@ export class ApiTokensController {
@Delete([ @Delete([
'/api/v1/db/meta/projects/:baseId/api-tokens/:token', '/api/v1/db/meta/projects/:baseId/api-tokens/:token',
'/api/v1/meta/bases/:baseId/api-tokens/:token', '/api/v2/meta/bases/:baseId/api-tokens/:token',
]) ])
@Acl('baseApiTokenDelete') @Acl('baseApiTokenDelete')
async apiTokenDelete(@Request() req, @Param('token') token: string) { async apiTokenDelete(@Request() req, @Param('token') token: string) {

4
packages/nocodb/src/controllers/attachments-secure.controller.ts

@ -26,7 +26,7 @@ export class AttachmentsSecureController {
constructor(private readonly attachmentsService: AttachmentsService) {} constructor(private readonly attachmentsService: AttachmentsService) {}
@UseGuards(MetaApiLimiterGuard, GlobalGuard) @UseGuards(MetaApiLimiterGuard, GlobalGuard)
@Post(['/api/v1/db/storage/upload', '/api/v1/storage/upload']) @Post(['/api/v1/db/storage/upload', '/api/v2/storage/upload'])
@HttpCode(200) @HttpCode(200)
@UseInterceptors(UploadAllowedInterceptor, AnyFilesInterceptor()) @UseInterceptors(UploadAllowedInterceptor, AnyFilesInterceptor())
async upload(@UploadedFiles() files: Array<any>, @Request() req) { async upload(@UploadedFiles() files: Array<any>, @Request() req) {
@ -40,7 +40,7 @@ export class AttachmentsSecureController {
return attachments; return attachments;
} }
@Post(['/api/v1/db/storage/upload-by-url', '/api/v1/storage/upload-by-url']) @Post(['/api/v1/db/storage/upload-by-url', '/api/v2/storage/upload-by-url'])
@HttpCode(200) @HttpCode(200)
@UseInterceptors(UploadAllowedInterceptor) @UseInterceptors(UploadAllowedInterceptor)
@UseGuards(MetaApiLimiterGuard, GlobalGuard) @UseGuards(MetaApiLimiterGuard, GlobalGuard)

4
packages/nocodb/src/controllers/attachments.controller.ts

@ -25,7 +25,7 @@ export class AttachmentsController {
constructor(private readonly attachmentsService: AttachmentsService) {} constructor(private readonly attachmentsService: AttachmentsService) {}
@UseGuards(MetaApiLimiterGuard, GlobalGuard) @UseGuards(MetaApiLimiterGuard, GlobalGuard)
@Post(['/api/v1/db/storage/upload', '/api/v1/storage/upload']) @Post(['/api/v1/db/storage/upload', '/api/v2/storage/upload'])
@HttpCode(200) @HttpCode(200)
@UseInterceptors(UploadAllowedInterceptor, AnyFilesInterceptor()) @UseInterceptors(UploadAllowedInterceptor, AnyFilesInterceptor())
async upload( async upload(
@ -41,7 +41,7 @@ export class AttachmentsController {
return attachments; return attachments;
} }
@Post(['/api/v1/db/storage/upload-by-url', '/api/v1/storage/upload-by-url']) @Post(['/api/v1/db/storage/upload-by-url', '/api/v2/storage/upload-by-url'])
@HttpCode(200) @HttpCode(200)
@UseInterceptors(UploadAllowedInterceptor) @UseInterceptors(UploadAllowedInterceptor)
@UseGuards(MetaApiLimiterGuard, GlobalGuard) @UseGuards(MetaApiLimiterGuard, GlobalGuard)

12
packages/nocodb/src/controllers/audits.controller.ts

@ -21,7 +21,7 @@ import { MetaApiLimiterGuard } from '~/guards/meta-api-limiter.guard';
export class AuditsController { export class AuditsController {
constructor(private readonly auditsService: AuditsService) {} constructor(private readonly auditsService: AuditsService) {}
@Post(['/api/v1/db/meta/audits/comments', '/api/v1/meta/audits/comments']) @Post(['/api/v1/db/meta/audits/comments', '/api/v2/meta/audits/comments'])
@HttpCode(200) @HttpCode(200)
@Acl('commentRow') @Acl('commentRow')
async commentRow(@Request() req) { async commentRow(@Request() req) {
@ -33,7 +33,7 @@ export class AuditsController {
@Post([ @Post([
'/api/v1/db/meta/audits/rows/:rowId/update', '/api/v1/db/meta/audits/rows/:rowId/update',
'/api/v1/meta/audits/rows/:rowId/update', '/api/v2/meta/audits/rows/:rowId/update',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('auditRowUpdate') @Acl('auditRowUpdate')
@ -44,7 +44,7 @@ export class AuditsController {
}); });
} }
@Get(['/api/v1/db/meta/audits/comments', '/api/v1/meta/audits/comments']) @Get(['/api/v1/db/meta/audits/comments', '/api/v2/meta/audits/comments'])
@Acl('commentList') @Acl('commentList')
async commentList(@Request() req) { async commentList(@Request() req) {
return new PagedResponseImpl( return new PagedResponseImpl(
@ -54,7 +54,7 @@ export class AuditsController {
@Patch([ @Patch([
'/api/v1/db/meta/audits/:auditId/comment', '/api/v1/db/meta/audits/:auditId/comment',
'/api/v1/meta/audits/:auditId/comment', '/api/v2/meta/audits/:auditId/comment',
]) ])
@Acl('commentUpdate') @Acl('commentUpdate')
async commentUpdate( async commentUpdate(
@ -71,7 +71,7 @@ export class AuditsController {
@Get([ @Get([
'/api/v1/db/meta/projects/:baseId/audits/', '/api/v1/db/meta/projects/:baseId/audits/',
'/api/v1/meta/bases/:baseId/audits/', '/api/v2/meta/bases/:baseId/audits/',
]) ])
@Acl('auditList') @Acl('auditList')
async auditList(@Request() req, @Param('baseId') baseId: string) { async auditList(@Request() req, @Param('baseId') baseId: string) {
@ -89,7 +89,7 @@ export class AuditsController {
@Get([ @Get([
'/api/v1/db/meta/audits/comments/count', '/api/v1/db/meta/audits/comments/count',
'/api/v1/meta/audits/comments/count', '/api/v2/meta/audits/comments/count',
]) ])
@Acl('commentsCount') @Acl('commentsCount')
async commentsCount( async commentsCount(

12
packages/nocodb/src/controllers/base-users.controller.ts

@ -24,7 +24,7 @@ export class BaseUsersController {
@Get([ @Get([
'/api/v1/db/meta/projects/:baseId/users', '/api/v1/db/meta/projects/:baseId/users',
'/api/v1/meta/bases/:baseId/users', '/api/v2/meta/bases/:baseId/users',
]) ])
@Acl('userList') @Acl('userList')
async userList(@Param('baseId') baseId: string, @Request() req) { async userList(@Param('baseId') baseId: string, @Request() req) {
@ -38,7 +38,7 @@ export class BaseUsersController {
@Post([ @Post([
'/api/v1/db/meta/projects/:baseId/users', '/api/v1/db/meta/projects/:baseId/users',
'/api/v1/meta/bases/:baseId/users', '/api/v2/meta/bases/:baseId/users',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('userInvite') @Acl('userInvite')
@ -60,7 +60,7 @@ export class BaseUsersController {
@Patch([ @Patch([
'/api/v1/db/meta/projects/:baseId/users/:userId', '/api/v1/db/meta/projects/:baseId/users/:userId',
'/api/v1/meta/bases/:baseId/users/:userId', '/api/v2/meta/bases/:baseId/users/:userId',
]) ])
@Acl('baseUserUpdate') @Acl('baseUserUpdate')
async baseUserUpdate( async baseUserUpdate(
@ -85,7 +85,7 @@ export class BaseUsersController {
@Delete([ @Delete([
'/api/v1/db/meta/projects/:baseId/users/:userId', '/api/v1/db/meta/projects/:baseId/users/:userId',
'/api/v1/meta/bases/:baseId/users/:userId', '/api/v2/meta/bases/:baseId/users/:userId',
]) ])
@Acl('baseUserDelete') @Acl('baseUserDelete')
async baseUserDelete( async baseUserDelete(
@ -105,7 +105,7 @@ export class BaseUsersController {
@Post([ @Post([
'/api/v1/db/meta/projects/:baseId/users/:userId/resend-invite', '/api/v1/db/meta/projects/:baseId/users/:userId/resend-invite',
'/api/v1/meta/bases/:baseId/users/:userId/resend-invite', '/api/v2/meta/bases/:baseId/users/:userId/resend-invite',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('baseUserInviteResend') @Acl('baseUserInviteResend')
@ -128,7 +128,7 @@ export class BaseUsersController {
@Patch([ @Patch([
'/api/v1/db/meta/projects/:baseId/user', '/api/v1/db/meta/projects/:baseId/user',
'/api/v1/meta/bases/:baseId/user', '/api/v2/meta/bases/:baseId/user',
]) ])
@Acl('baseUserMetaUpdate') @Acl('baseUserMetaUpdate')
async baseUserMetaUpdate( async baseUserMetaUpdate(

14
packages/nocodb/src/controllers/bases.controller.ts

@ -31,7 +31,7 @@ export class BasesController {
@Acl('baseList', { @Acl('baseList', {
scope: 'org', scope: 'org',
}) })
@Get(['/api/v1/db/meta/projects/', '/api/v1/meta/bases/']) @Get(['/api/v1/db/meta/projects/', '/api/v2/meta/bases/'])
async list(@Query() queryParams: Record<string, any>, @Request() req) { async list(@Query() queryParams: Record<string, any>, @Request() req) {
const bases = await this.projectsService.baseList({ const bases = await this.projectsService.baseList({
user: req.user, user: req.user,
@ -46,7 +46,7 @@ export class BasesController {
@Acl('baseInfoGet') @Acl('baseInfoGet')
@Get([ @Get([
'/api/v1/db/meta/projects/:baseId/info', '/api/v1/db/meta/projects/:baseId/info',
'/api/v1/meta/bases/:baseId/info', '/api/v2/meta/bases/:baseId/info',
]) ])
async baseInfoGet() { async baseInfoGet() {
return { return {
@ -60,7 +60,7 @@ export class BasesController {
} }
@Acl('baseGet') @Acl('baseGet')
@Get(['/api/v1/db/meta/projects/:baseId', '/api/v1/meta/bases/:baseId']) @Get(['/api/v1/db/meta/projects/:baseId', '/api/v2/meta/bases/:baseId'])
async baseGet(@Param('baseId') baseId: string) { async baseGet(@Param('baseId') baseId: string) {
const base = await this.projectsService.getProjectWithInfo({ const base = await this.projectsService.getProjectWithInfo({
baseId: baseId, baseId: baseId,
@ -72,7 +72,7 @@ export class BasesController {
} }
@Acl('baseUpdate') @Acl('baseUpdate')
@Patch(['/api/v1/db/meta/projects/:baseId', '/api/v1/meta/bases/:baseId']) @Patch(['/api/v1/db/meta/projects/:baseId', '/api/v2/meta/bases/:baseId'])
async baseUpdate( async baseUpdate(
@Param('baseId') baseId: string, @Param('baseId') baseId: string,
@Body() body: Record<string, any>, @Body() body: Record<string, any>,
@ -88,7 +88,7 @@ export class BasesController {
} }
@Acl('baseDelete') @Acl('baseDelete')
@Delete(['/api/v1/db/meta/projects/:baseId', '/api/v1/meta/bases/:baseId']) @Delete(['/api/v1/db/meta/projects/:baseId', '/api/v2/meta/bases/:baseId'])
async baseDelete(@Param('baseId') baseId: string, @Request() req) { async baseDelete(@Param('baseId') baseId: string, @Request() req) {
const deleted = await this.projectsService.baseSoftDelete({ const deleted = await this.projectsService.baseSoftDelete({
baseId, baseId,
@ -101,7 +101,7 @@ export class BasesController {
@Acl('baseCreate', { @Acl('baseCreate', {
scope: 'org', scope: 'org',
}) })
@Post(['/api/v1/db/meta/projects', '/api/v1/meta/bases']) @Post(['/api/v1/db/meta/projects', '/api/v2/meta/bases'])
@HttpCode(200) @HttpCode(200)
async baseCreate(@Body() baseBody: ProjectReqType, @Request() req) { async baseCreate(@Body() baseBody: ProjectReqType, @Request() req) {
const base = await this.projectsService.baseCreate({ const base = await this.projectsService.baseCreate({
@ -115,7 +115,7 @@ export class BasesController {
@Acl('hasEmptyOrNullFilters') @Acl('hasEmptyOrNullFilters')
@Get([ @Get([
'/api/v1/db/meta/projects/:baseId/has-empty-or-null-filters', '/api/v1/db/meta/projects/:baseId/has-empty-or-null-filters',
'/api/v1/meta/bases/:baseId/has-empty-or-null-filters', '/api/v2/meta/bases/:baseId/has-empty-or-null-filters',
]) ])
async hasEmptyOrNullFilters(@Param('baseId') baseId: string) { async hasEmptyOrNullFilters(@Param('baseId') baseId: string) {
return await Filter.hasEmptyOrNullFilters(baseId); return await Filter.hasEmptyOrNullFilters(baseId);

25
packages/nocodb/src/controllers/bulk-data-alias.controller.ts

@ -20,10 +20,7 @@ import { DataApiLimiterGuard } from '~/guards/data-api-limiter.guard';
export class BulkDataAliasController { export class BulkDataAliasController {
constructor(private bulkDataAliasService: BulkDataAliasService) {} constructor(private bulkDataAliasService: BulkDataAliasService) {}
@Post([ @Post(['/api/v1/db/data/bulk/:orgs/:baseName/:tableName'])
'/api/v1/db/data/bulk/:orgs/:baseName/:tableName',
'/api/v1/data/bulk/:orgs/:baseName/:tableName',
])
@HttpCode(200) @HttpCode(200)
@Acl('bulkDataInsert') @Acl('bulkDataInsert')
async bulkDataInsert( async bulkDataInsert(
@ -43,10 +40,7 @@ export class BulkDataAliasController {
res.json(exists); res.json(exists);
} }
@Patch([ @Patch(['/api/v1/db/data/bulk/:orgs/:baseName/:tableName'])
'/api/v1/db/data/bulk/:orgs/:baseName/:tableName',
'/api/v1/data/bulk/:orgs/:baseName/:tableName',
])
@Acl('bulkDataUpdate') @Acl('bulkDataUpdate')
async bulkDataUpdate( async bulkDataUpdate(
@Request() req, @Request() req,
@ -63,10 +57,7 @@ export class BulkDataAliasController {
} }
// todo: Integrate with filterArrJson bulkDataUpdateAll // todo: Integrate with filterArrJson bulkDataUpdateAll
@Patch([ @Patch(['/api/v1/db/data/bulk/:orgs/:baseName/:tableName/all'])
'/api/v1/db/data/bulk/:orgs/:baseName/:tableName/all',
'/api/v1/data/bulk/:orgs/:baseName/:tableName/all',
])
@Acl('bulkDataUpdateAll') @Acl('bulkDataUpdateAll')
async bulkDataUpdateAll( async bulkDataUpdateAll(
@Request() req, @Request() req,
@ -83,10 +74,7 @@ export class BulkDataAliasController {
}); });
} }
@Delete([ @Delete(['/api/v1/db/data/bulk/:orgs/:baseName/:tableName'])
'/api/v1/db/data/bulk/:orgs/:baseName/:tableName',
'/api/v1/data/bulk/:orgs/:baseName/:tableName',
])
@Acl('bulkDataDelete') @Acl('bulkDataDelete')
async bulkDataDelete( async bulkDataDelete(
@Request() req, @Request() req,
@ -104,10 +92,7 @@ export class BulkDataAliasController {
// todo: Integrate with filterArrJson bulkDataDeleteAll // todo: Integrate with filterArrJson bulkDataDeleteAll
@Delete([ @Delete(['/api/v1/db/data/bulk/:orgs/:baseName/:tableName/all'])
'/api/v1/db/data/bulk/:orgs/:baseName/:tableName/all',
'/api/v1/data/bulk/:orgs/:baseName/:tableName/all',
])
@Acl('bulkDataDeleteAll') @Acl('bulkDataDeleteAll')
async bulkDataDeleteAll( async bulkDataDeleteAll(
@Request() req, @Request() req,

4
packages/nocodb/src/controllers/caches.controller.ts

@ -10,7 +10,7 @@ import { MetaApiLimiterGuard } from '~/guards/meta-api-limiter.guard';
export class CachesController { export class CachesController {
constructor(private readonly cachesService: CachesService) {} constructor(private readonly cachesService: CachesService) {}
@Get(['/api/v1/db/meta/cache', '/api/v1/meta/cache']) @Get(['/api/v1/db/meta/cache', '/api/v2/meta/cache'])
@Acl('cacheGet', { @Acl('cacheGet', {
scope: 'org', scope: 'org',
allowedRoles: [OrgUserRoles.SUPER_ADMIN], allowedRoles: [OrgUserRoles.SUPER_ADMIN],
@ -25,7 +25,7 @@ export class CachesController {
return JSON.stringify(data); return JSON.stringify(data);
} }
@Delete(['/api/v1/db/meta/cache', '/api/v1/meta/cache']) @Delete(['/api/v1/db/meta/cache', '/api/v2/meta/cache'])
@Acl('cacheDelete', { @Acl('cacheDelete', {
scope: 'org', scope: 'org',
allowedRoles: [OrgUserRoles.SUPER_ADMIN], allowedRoles: [OrgUserRoles.SUPER_ADMIN],

14
packages/nocodb/src/controllers/columns.controller.ts

@ -24,7 +24,7 @@ export class ColumnsController {
@Post([ @Post([
'/api/v1/db/meta/tables/:tableId/columns/', '/api/v1/db/meta/tables/:tableId/columns/',
'/api/v1/meta/tables/:tableId/columns/', '/api/v2/meta/tables/:tableId/columns/',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('columnAdd') @Acl('columnAdd')
@ -43,7 +43,7 @@ export class ColumnsController {
@Patch([ @Patch([
'/api/v1/db/meta/columns/:columnId', '/api/v1/db/meta/columns/:columnId',
'/api/v1/meta/columns/:columnId', '/api/v2/meta/columns/:columnId',
]) ])
@Acl('columnUpdate') @Acl('columnUpdate')
async columnUpdate( async columnUpdate(
@ -61,7 +61,7 @@ export class ColumnsController {
@Delete([ @Delete([
'/api/v1/db/meta/columns/:columnId', '/api/v1/db/meta/columns/:columnId',
'/api/v1/meta/columns/:columnId', '/api/v2/meta/columns/:columnId',
]) ])
@Acl('columnDelete') @Acl('columnDelete')
async columnDelete(@Param('columnId') columnId: string, @Request() req: any) { async columnDelete(@Param('columnId') columnId: string, @Request() req: any) {
@ -72,7 +72,7 @@ export class ColumnsController {
}); });
} }
@Get(['/api/v1/db/meta/columns/:columnId', '/api/v1/meta/columns/:columnId']) @Get(['/api/v1/db/meta/columns/:columnId', '/api/v2/meta/columns/:columnId'])
@Acl('columnGet') @Acl('columnGet')
async columnGet(@Param('columnId') columnId: string) { async columnGet(@Param('columnId') columnId: string) {
return await this.columnsService.columnGet({ columnId }); return await this.columnsService.columnGet({ columnId });
@ -80,7 +80,7 @@ export class ColumnsController {
@Post([ @Post([
'/api/v1/db/meta/columns/:columnId/primary', '/api/v1/db/meta/columns/:columnId/primary',
'/api/v1/meta/columns/:columnId/primary', '/api/v2/meta/columns/:columnId/primary',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('columnSetAsPrimary') @Acl('columnSetAsPrimary')
@ -90,7 +90,7 @@ export class ColumnsController {
@Get([ @Get([
'/api/v1/db/meta/tables/:tableId/columns/hash', '/api/v1/db/meta/tables/:tableId/columns/hash',
'/api/v1/meta/tables/:tableId/columns/hash', '/api/v2/meta/tables/:tableId/columns/hash',
]) ])
@Acl('columnsHash') @Acl('columnsHash')
async columnsHash(@Param('tableId') tableId: string) { async columnsHash(@Param('tableId') tableId: string) {
@ -99,7 +99,7 @@ export class ColumnsController {
@Post([ @Post([
'/api/v1/db/meta/tables/:tableId/columns/bulk', '/api/v1/db/meta/tables/:tableId/columns/bulk',
'/api/v1/meta/tables/:tableId/columns/bulk', '/api/v2/meta/tables/:tableId/columns/bulk',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('columnBulk') @Acl('columnBulk')

4
packages/nocodb/src/controllers/data-alias-export.controller.ts

@ -15,8 +15,6 @@ export class DataAliasExportController {
@Get([ @Get([
'/api/v1/db/data/:orgs/:baseName/:tableName/export/excel', '/api/v1/db/data/:orgs/:baseName/:tableName/export/excel',
'/api/v1/db/data/:orgs/:baseName/:tableName/views/:viewName/export/excel', '/api/v1/db/data/:orgs/:baseName/:tableName/views/:viewName/export/excel',
'/api/v1/data/:orgs/:baseName/:tableName/export/excel',
'/api/v1/data/:orgs/:baseName/:tableName/views/:viewName/export/excel',
]) ])
@Acl('exportExcel') @Acl('exportExcel')
async excelDataExport(@Request() req, @Response() res) { async excelDataExport(@Request() req, @Response() res) {
@ -44,8 +42,6 @@ export class DataAliasExportController {
@Get([ @Get([
'/api/v1/db/data/:orgs/:baseName/:tableName/views/:viewName/export/csv', '/api/v1/db/data/:orgs/:baseName/:tableName/views/:viewName/export/csv',
'/api/v1/db/data/:orgs/:baseName/:tableName/export/csv', '/api/v1/db/data/:orgs/:baseName/:tableName/export/csv',
'/api/v1/data/:orgs/:baseName/:tableName/views/:viewName/export/csv',
'/api/v1/data/:orgs/:baseName/:tableName/export/csv',
]) ])
@Acl('exportCsv') @Acl('exportCsv')
async csvDataExport(@Request() req, @Response() res) { async csvDataExport(@Request() req, @Response() res) {

15
packages/nocodb/src/controllers/data-alias-nested.controller.ts

@ -19,10 +19,7 @@ export class DataAliasNestedController {
constructor(private dataAliasNestedService: DataAliasNestedService) {} constructor(private dataAliasNestedService: DataAliasNestedService) {}
// todo: handle case where the given column is not ltar // todo: handle case where the given column is not ltar
@Get([ @Get(['/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/mm/:columnName'])
'/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/mm/:columnName',
'/api/v1/data/:orgs/:baseName/:tableName/:rowId/mm/:columnName',
])
@Acl('mmList') @Acl('mmList')
async mmList( async mmList(
@Request() req, @Request() req,
@ -42,7 +39,6 @@ export class DataAliasNestedController {
@Get([ @Get([
'/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/mm/:columnName/exclude', '/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/mm/:columnName/exclude',
'/api/v1/data/:orgs/:baseName/:tableName/:rowId/mm/:columnName/exclude',
]) ])
@Acl('mmExcludedList') @Acl('mmExcludedList')
async mmExcludedList( async mmExcludedList(
@ -63,7 +59,6 @@ export class DataAliasNestedController {
@Get([ @Get([
'/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/hm/:columnName/exclude', '/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/hm/:columnName/exclude',
'/api/v1/data/:orgs/:baseName/:tableName/:rowId/hm/:columnName/exclude',
]) ])
@Acl('hmExcludedList') @Acl('hmExcludedList')
async hmExcludedList( async hmExcludedList(
@ -84,7 +79,6 @@ export class DataAliasNestedController {
@Get([ @Get([
'/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/bt/:columnName/exclude', '/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/bt/:columnName/exclude',
'/api/v1/data/:orgs/:baseName/:tableName/:rowId/bt/:columnName/exclude',
]) ])
@Acl('btExcludedList') @Acl('btExcludedList')
async btExcludedList( async btExcludedList(
@ -105,10 +99,7 @@ export class DataAliasNestedController {
// todo: handle case where the given column is not ltar // todo: handle case where the given column is not ltar
@Get([ @Get(['/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/hm/:columnName'])
'/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/hm/:columnName',
'/api/v1/data/:orgs/:baseName/:tableName/:rowId/hm/:columnName',
])
@Acl('hmList') @Acl('hmList')
async hmList( async hmList(
@Request() req, @Request() req,
@ -128,7 +119,6 @@ export class DataAliasNestedController {
@Delete([ @Delete([
'/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/:relationType/:columnName/:refRowId', '/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/:relationType/:columnName/:refRowId',
'/api/v1/data/:orgs/:baseName/:tableName/:rowId/:relationType/:columnName/:refRowId',
]) ])
@Acl('relationDataRemove') @Acl('relationDataRemove')
async relationDataRemove( async relationDataRemove(
@ -154,7 +144,6 @@ export class DataAliasNestedController {
// todo: Give proper error message when reference row is already related and handle duplicate ref row id in hm // todo: Give proper error message when reference row is already related and handle duplicate ref row id in hm
@Post([ @Post([
'/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/:relationType/:columnName/:refRowId', '/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/:relationType/:columnName/:refRowId',
'/api/v1/data/:orgs/:baseName/:tableName/:rowId/:relationType/:columnName/:refRowId',
]) ])
@Acl('relationDataAdd') @Acl('relationDataAdd')
@HttpCode(200) @HttpCode(200)

20
packages/nocodb/src/controllers/data-alias.controller.ts

@ -27,8 +27,6 @@ export class DataAliasController {
@Get([ @Get([
'/api/v1/db/data/:orgs/:baseName/:tableName', '/api/v1/db/data/:orgs/:baseName/:tableName',
'/api/v1/db/data/:orgs/:baseName/:tableName/views/:viewName', '/api/v1/db/data/:orgs/:baseName/:tableName/views/:viewName',
'/api/v1/data/:orgs/:baseName/:tableName',
'/api/v1/data/:orgs/:baseName/:tableName/views/:viewName',
]) ])
@Acl('dataList') @Acl('dataList')
async dataList( async dataList(
@ -61,8 +59,6 @@ export class DataAliasController {
@Get([ @Get([
'/api/v1/db/data/:orgs/:baseName/:tableName/find-one', '/api/v1/db/data/:orgs/:baseName/:tableName/find-one',
'/api/v1/db/data/:orgs/:baseName/:tableName/views/:viewName/find-one', '/api/v1/db/data/:orgs/:baseName/:tableName/views/:viewName/find-one',
'/api/v1/data/:orgs/:baseName/:tableName/find-one',
'/api/v1/data/:orgs/:baseName/:tableName/views/:viewName/find-one',
]) ])
@Acl('dataFindOne') @Acl('dataFindOne')
async dataFindOne( async dataFindOne(
@ -82,8 +78,6 @@ export class DataAliasController {
@Get([ @Get([
'/api/v1/db/data/:orgs/:baseName/:tableName/groupby', '/api/v1/db/data/:orgs/:baseName/:tableName/groupby',
'/api/v1/db/data/:orgs/:baseName/:tableName/views/:viewName/groupby', '/api/v1/db/data/:orgs/:baseName/:tableName/views/:viewName/groupby',
'/api/v1/data/:orgs/:baseName/:tableName/groupby',
'/api/v1/data/:orgs/:baseName/:tableName/views/:viewName/groupby',
]) ])
@Acl('dataGroupBy') @Acl('dataGroupBy')
async dataGroupBy( async dataGroupBy(
@ -103,8 +97,6 @@ export class DataAliasController {
@Get([ @Get([
'/api/v1/db/data/:orgs/:baseName/:tableName/count', '/api/v1/db/data/:orgs/:baseName/:tableName/count',
'/api/v1/db/data/:orgs/:baseName/:tableName/views/:viewName/count', '/api/v1/db/data/:orgs/:baseName/:tableName/views/:viewName/count',
'/api/v1/data/:orgs/:baseName/:tableName/count',
'/api/v1/data/:orgs/:baseName/:tableName/views/:viewName/count',
]) ])
@Acl('dataCount') @Acl('dataCount')
async dataCount( async dataCount(
@ -127,8 +119,6 @@ export class DataAliasController {
@Post([ @Post([
'/api/v1/db/data/:orgs/:baseName/:tableName', '/api/v1/db/data/:orgs/:baseName/:tableName',
'/api/v1/db/data/:orgs/:baseName/:tableName/views/:viewName', '/api/v1/db/data/:orgs/:baseName/:tableName/views/:viewName',
'/api/v1/data/:orgs/:baseName/:tableName',
'/api/v1/data/:orgs/:baseName/:tableName/views/:viewName',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('dataInsert') @Acl('dataInsert')
@ -153,8 +143,6 @@ export class DataAliasController {
@Patch([ @Patch([
'/api/v1/db/data/:orgs/:baseName/:tableName/:rowId', '/api/v1/db/data/:orgs/:baseName/:tableName/:rowId',
'/api/v1/db/data/:orgs/:baseName/:tableName/views/:viewName/:rowId', '/api/v1/db/data/:orgs/:baseName/:tableName/views/:viewName/:rowId',
'/api/v1/data/:orgs/:baseName/:tableName/:rowId',
'/api/v1/data/:orgs/:baseName/:tableName/views/:viewName/:rowId',
]) ])
@Acl('dataUpdate') @Acl('dataUpdate')
async dataUpdate( async dataUpdate(
@ -179,8 +167,6 @@ export class DataAliasController {
@Delete([ @Delete([
'/api/v1/db/data/:orgs/:baseName/:tableName/:rowId', '/api/v1/db/data/:orgs/:baseName/:tableName/:rowId',
'/api/v1/db/data/:orgs/:baseName/:tableName/views/:viewName/:rowId', '/api/v1/db/data/:orgs/:baseName/:tableName/views/:viewName/:rowId',
'/api/v1/data/:orgs/:baseName/:tableName/:rowId',
'/api/v1/data/:orgs/:baseName/:tableName/views/:viewName/:rowId',
]) ])
@Acl('dataDelete') @Acl('dataDelete')
async dataDelete( async dataDelete(
@ -202,8 +188,6 @@ export class DataAliasController {
@Get([ @Get([
'/api/v1/db/data/:orgs/:baseName/:tableName/:rowId', '/api/v1/db/data/:orgs/:baseName/:tableName/:rowId',
'/api/v1/db/data/:orgs/:baseName/:tableName/views/:viewName/:rowId', '/api/v1/db/data/:orgs/:baseName/:tableName/views/:viewName/:rowId',
'/api/v1/data/:orgs/:baseName/:tableName/:rowId',
'/api/v1/data/:orgs/:baseName/:tableName/views/:viewName/:rowId',
]) ])
@Acl('dataRead') @Acl('dataRead')
async dataRead( async dataRead(
@ -229,8 +213,6 @@ export class DataAliasController {
@Get([ @Get([
'/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/exist', '/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/exist',
'/api/v1/db/data/:orgs/:baseName/:tableName/views/:viewName/:rowId/exist', '/api/v1/db/data/:orgs/:baseName/:tableName/views/:viewName/:rowId/exist',
'/api/v1/data/:orgs/:baseName/:tableName/:rowId/exist',
'/api/v1/data/:orgs/:baseName/:tableName/views/:viewName/:rowId/exist',
]) ])
@Acl('dataExist') @Acl('dataExist')
async dataExist( async dataExist(
@ -257,8 +239,6 @@ export class DataAliasController {
@Get([ @Get([
'/api/v1/db/data/:orgs/:baseName/:tableName/group/:columnId', '/api/v1/db/data/:orgs/:baseName/:tableName/group/:columnId',
'/api/v1/db/data/:orgs/:baseName/:tableName/views/:viewName/group/:columnId', '/api/v1/db/data/:orgs/:baseName/:tableName/views/:viewName/group/:columnId',
'/api/v1/data/:orgs/:baseName/:tableName/group/:columnId',
'/api/v1/data/:orgs/:baseName/:tableName/views/:viewName/group/:columnId',
]) ])
@Acl('groupedDataList') @Acl('groupedDataList')
async groupedDataList( async groupedDataList(

16
packages/nocodb/src/controllers/filters.controller.ts

@ -24,7 +24,7 @@ export class FiltersController {
@Get([ @Get([
'/api/v1/db/meta/views/:viewId/filters', '/api/v1/db/meta/views/:viewId/filters',
'/api/v1/meta/views/:viewId/filters', '/api/v2/meta/views/:viewId/filters',
]) ])
@Acl('filterList') @Acl('filterList')
async filterList(@Param('viewId') viewId: string) { async filterList(@Param('viewId') viewId: string) {
@ -37,7 +37,7 @@ export class FiltersController {
@Post([ @Post([
'/api/v1/db/meta/views/:viewId/filters', '/api/v1/db/meta/views/:viewId/filters',
'/api/v1/meta/views/:viewId/filters', '/api/v2/meta/views/:viewId/filters',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('filterCreate') @Acl('filterCreate')
@ -56,7 +56,7 @@ export class FiltersController {
@Post([ @Post([
'/api/v1/db/meta/hooks/:hookId/filters', '/api/v1/db/meta/hooks/:hookId/filters',
'/api/v1/meta/hooks/:hookId/filters', '/api/v2/meta/hooks/:hookId/filters',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('hookFilterCreate') @Acl('hookFilterCreate')
@ -73,7 +73,7 @@ export class FiltersController {
return filter; return filter;
} }
@Get(['/api/v1/db/meta/filters/:filterId', '/api/v1/meta/filters/:filterId']) @Get(['/api/v1/db/meta/filters/:filterId', '/api/v2/meta/filters/:filterId'])
@Acl('filterGet') @Acl('filterGet')
async filterGet(@Param('filterId') filterId: string) { async filterGet(@Param('filterId') filterId: string) {
return await this.filtersService.filterGet({ filterId }); return await this.filtersService.filterGet({ filterId });
@ -81,7 +81,7 @@ export class FiltersController {
@Get([ @Get([
'/api/v1/db/meta/filters/:filterParentId/children', '/api/v1/db/meta/filters/:filterParentId/children',
'/api/v1/meta/filters/:filterParentId/children', '/api/v2/meta/filters/:filterParentId/children',
]) ])
@Acl('filterChildrenList') @Acl('filterChildrenList')
async filterChildrenRead(@Param('filterParentId') filterParentId: string) { async filterChildrenRead(@Param('filterParentId') filterParentId: string) {
@ -94,7 +94,7 @@ export class FiltersController {
@Patch([ @Patch([
'/api/v1/db/meta/filters/:filterId', '/api/v1/db/meta/filters/:filterId',
'/api/v1/meta/filters/:filterId', '/api/v2/meta/filters/:filterId',
]) ])
@Acl('filterUpdate') @Acl('filterUpdate')
async filterUpdate( async filterUpdate(
@ -112,7 +112,7 @@ export class FiltersController {
@Delete([ @Delete([
'/api/v1/db/meta/filters/:filterId', '/api/v1/db/meta/filters/:filterId',
'/api/v1/meta/filters/:filterId', '/api/v2/meta/filters/:filterId',
]) ])
@Acl('filterDelete') @Acl('filterDelete')
async filterDelete(@Param('filterId') filterId: string, @Req() _req) { async filterDelete(@Param('filterId') filterId: string, @Req() _req) {
@ -124,7 +124,7 @@ export class FiltersController {
@Get([ @Get([
'/api/v1/db/meta/hooks/:hookId/filters', '/api/v1/db/meta/hooks/:hookId/filters',
'/api/v1/meta/hooks/:hookId/filters', '/api/v2/meta/hooks/:hookId/filters',
]) ])
@Acl('hookFilterList') @Acl('hookFilterList')
async hookFilterList(@Param('hookId') hookId: string) { async hookFilterList(@Param('hookId') hookId: string) {

2
packages/nocodb/src/controllers/form-columns.controller.ts

@ -13,7 +13,7 @@ export class FormColumnsController {
@Patch([ @Patch([
'/api/v1/db/meta/form-columns/:formViewColumnId', '/api/v1/db/meta/form-columns/:formViewColumnId',
'/api/v1/meta/form-columns/:formViewColumnId', '/api/v2/meta/form-columns/:formViewColumnId',
]) ])
@Acl('columnUpdate') @Acl('columnUpdate')
async columnUpdate( async columnUpdate(

6
packages/nocodb/src/controllers/forms.controller.ts

@ -20,7 +20,7 @@ import { MetaApiLimiterGuard } from '~/guards/meta-api-limiter.guard';
export class FormsController { export class FormsController {
constructor(private readonly formsService: FormsService) {} constructor(private readonly formsService: FormsService) {}
@Get(['/api/v1/db/meta/forms/:formViewId', '/api/v1/meta/forms/:formViewId']) @Get(['/api/v1/db/meta/forms/:formViewId', '/api/v2/meta/forms/:formViewId'])
@Acl('formViewGet') @Acl('formViewGet')
async formViewGet(@Param('formViewId') formViewId: string) { async formViewGet(@Param('formViewId') formViewId: string) {
const formViewData = await this.formsService.formViewGet({ const formViewData = await this.formsService.formViewGet({
@ -31,7 +31,7 @@ export class FormsController {
@Post([ @Post([
'/api/v1/db/meta/tables/:tableId/forms', '/api/v1/db/meta/tables/:tableId/forms',
'/api/v1/meta/tables/:tableId/forms', '/api/v2/meta/tables/:tableId/forms',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('formViewCreate') @Acl('formViewCreate')
@ -49,7 +49,7 @@ export class FormsController {
} }
@Patch([ @Patch([
'/api/v1/db/meta/forms/:formViewId', '/api/v1/db/meta/forms/:formViewId',
'/api/v1/meta/forms/:formViewId', '/api/v2/meta/forms/:formViewId',
]) ])
@Acl('formViewUpdate') @Acl('formViewUpdate')
async formViewUpdate(@Param('formViewId') formViewId: string, @Body() body) { async formViewUpdate(@Param('formViewId') formViewId: string, @Body() body) {

6
packages/nocodb/src/controllers/galleries.controller.ts

@ -22,7 +22,7 @@ export class GalleriesController {
@Get([ @Get([
'/api/v1/db/meta/galleries/:galleryViewId', '/api/v1/db/meta/galleries/:galleryViewId',
'/api/v1/meta/galleries/:galleryViewId', '/api/v2/meta/galleries/:galleryViewId',
]) ])
@Acl('galleryViewGet') @Acl('galleryViewGet')
async galleryViewGet(@Param('galleryViewId') galleryViewId: string) { async galleryViewGet(@Param('galleryViewId') galleryViewId: string) {
@ -33,7 +33,7 @@ export class GalleriesController {
@Post([ @Post([
'/api/v1/db/meta/tables/:tableId/galleries', '/api/v1/db/meta/tables/:tableId/galleries',
'/api/v1/meta/tables/:tableId/galleries', '/api/v2/meta/tables/:tableId/galleries',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('galleryViewCreate') @Acl('galleryViewCreate')
@ -52,7 +52,7 @@ export class GalleriesController {
@Patch([ @Patch([
'/api/v1/db/meta/galleries/:galleryViewId', '/api/v1/db/meta/galleries/:galleryViewId',
'/api/v1/meta/galleries/:galleryViewId', '/api/v2/meta/galleries/:galleryViewId',
]) ])
@Acl('galleryViewUpdate') @Acl('galleryViewUpdate')
async galleryViewUpdate( async galleryViewUpdate(

4
packages/nocodb/src/controllers/grid-columns.controller.ts

@ -12,7 +12,7 @@ export class GridColumnsController {
@Get([ @Get([
'/api/v1/db/meta/grids/:gridViewId/grid-columns', '/api/v1/db/meta/grids/:gridViewId/grid-columns',
'/api/v1/meta/grids/:gridViewId/grid-columns', '/api/v2/meta/grids/:gridViewId/grid-columns',
]) ])
@Acl('columnList') @Acl('columnList')
async columnList(@Param('gridViewId') gridViewId: string) { async columnList(@Param('gridViewId') gridViewId: string) {
@ -22,7 +22,7 @@ export class GridColumnsController {
} }
@Patch([ @Patch([
'/api/v1/db/meta/grid-columns/:gridViewColumnId', '/api/v1/db/meta/grid-columns/:gridViewColumnId',
'/api/v1/meta/grid-columns/:gridViewColumnId', '/api/v2/meta/grid-columns/:gridViewColumnId',
]) ])
@Acl('gridColumnUpdate') @Acl('gridColumnUpdate')
async gridColumnUpdate( async gridColumnUpdate(

4
packages/nocodb/src/controllers/grids.controller.ts

@ -21,7 +21,7 @@ export class GridsController {
@Post([ @Post([
'/api/v1/db/meta/tables/:tableId/grids/', '/api/v1/db/meta/tables/:tableId/grids/',
'/api/v1/meta/tables/:tableId/grids/', '/api/v2/meta/tables/:tableId/grids/',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('gridViewCreate') @Acl('gridViewCreate')
@ -36,7 +36,7 @@ export class GridsController {
}); });
return view; return view;
} }
@Patch(['/api/v1/db/meta/grids/:viewId', '/api/v1/meta/grids/:viewId']) @Patch(['/api/v1/db/meta/grids/:viewId', '/api/v2/meta/grids/:viewId'])
@Acl('gridViewUpdate') @Acl('gridViewUpdate')
async gridViewUpdate(@Param('viewId') viewId: string, @Body() body) { async gridViewUpdate(@Param('viewId') viewId: string, @Body() body) {
return await this.gridsService.gridViewUpdate({ return await this.gridsService.gridViewUpdate({

14
packages/nocodb/src/controllers/hooks.controller.ts

@ -25,7 +25,7 @@ export class HooksController {
@Get([ @Get([
'/api/v1/db/meta/tables/:tableId/hooks', '/api/v1/db/meta/tables/:tableId/hooks',
'/api/v1/meta/tables/:tableId/hooks', '/api/v2/meta/tables/:tableId/hooks',
]) ])
@Acl('hookList') @Acl('hookList')
async hookList(@Param('tableId') tableId: string) { async hookList(@Param('tableId') tableId: string) {
@ -34,7 +34,7 @@ export class HooksController {
@Post([ @Post([
'/api/v1/db/meta/tables/:tableId/hooks', '/api/v1/db/meta/tables/:tableId/hooks',
'/api/v1/meta/tables/:tableId/hooks', '/api/v2/meta/tables/:tableId/hooks',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('hookCreate') @Acl('hookCreate')
@ -49,13 +49,13 @@ export class HooksController {
return hook; return hook;
} }
@Delete(['/api/v1/db/meta/hooks/:hookId', '/api/v1/meta/hooks/:hookId']) @Delete(['/api/v1/db/meta/hooks/:hookId', '/api/v2/meta/hooks/:hookId'])
@Acl('hookDelete') @Acl('hookDelete')
async hookDelete(@Param('hookId') hookId: string) { async hookDelete(@Param('hookId') hookId: string) {
return await this.hooksService.hookDelete({ hookId }); return await this.hooksService.hookDelete({ hookId });
} }
@Patch(['/api/v1/db/meta/hooks/:hookId', '/api/v1/meta/hooks/:hookId']) @Patch(['/api/v1/db/meta/hooks/:hookId', '/api/v2/meta/hooks/:hookId'])
@Acl('hookUpdate') @Acl('hookUpdate')
async hookUpdate(@Param('hookId') hookId: string, @Body() body: HookReqType) { async hookUpdate(@Param('hookId') hookId: string, @Body() body: HookReqType) {
return await this.hooksService.hookUpdate({ hookId, hook: body }); return await this.hooksService.hookUpdate({ hookId, hook: body });
@ -63,7 +63,7 @@ export class HooksController {
@Post([ @Post([
'/api/v1/db/meta/tables/:tableId/hooks/test', '/api/v1/db/meta/tables/:tableId/hooks/test',
'/api/v1/meta/tables/:tableId/hooks/test', '/api/v2/meta/tables/:tableId/hooks/test',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('hookTest') @Acl('hookTest')
@ -88,7 +88,7 @@ export class HooksController {
@Get([ @Get([
'/api/v1/db/meta/tables/:tableId/hooks/samplePayload/:operation/:version', '/api/v1/db/meta/tables/:tableId/hooks/samplePayload/:operation/:version',
'/api/v1/meta/tables/:tableId/hooks/samplePayload/:operation/:version', '/api/v2/meta/tables/:tableId/hooks/samplePayload/:operation/:version',
]) ])
@Acl('tableSampleData') @Acl('tableSampleData')
async tableSampleData( async tableSampleData(
@ -105,7 +105,7 @@ export class HooksController {
@Get([ @Get([
'/api/v1/db/meta/hooks/:hookId/logs', '/api/v1/db/meta/hooks/:hookId/logs',
'/api/v1/meta/hooks/:hookId/logs', '/api/v2/meta/hooks/:hookId/logs',
]) ])
@Acl('hookLogList') @Acl('hookLogList')
async hookLogList(@Param('hookId') hookId: string, @Request() req: any) { async hookLogList(@Param('hookId') hookId: string, @Request() req: any) {

6
packages/nocodb/src/controllers/kanbans.controller.ts

@ -22,7 +22,7 @@ export class KanbansController {
@Get([ @Get([
'/api/v1/db/meta/kanbans/:kanbanViewId', '/api/v1/db/meta/kanbans/:kanbanViewId',
'/api/v1/meta/kanbans/:kanbanViewId', '/api/v2/meta/kanbans/:kanbanViewId',
]) ])
@Acl('kanbanViewGet') @Acl('kanbanViewGet')
async kanbanViewGet(@Param('kanbanViewId') kanbanViewId: string) { async kanbanViewGet(@Param('kanbanViewId') kanbanViewId: string) {
@ -33,7 +33,7 @@ export class KanbansController {
@Post([ @Post([
'/api/v1/db/meta/tables/:tableId/kanbans', '/api/v1/db/meta/tables/:tableId/kanbans',
'/api/v1/meta/tables/:tableId/kanbans', '/api/v2/meta/tables/:tableId/kanbans',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('kanbanViewCreate') @Acl('kanbanViewCreate')
@ -51,7 +51,7 @@ export class KanbansController {
@Patch([ @Patch([
'/api/v1/db/meta/kanbans/:kanbanViewId', '/api/v1/db/meta/kanbans/:kanbanViewId',
'/api/v1/meta/kanbans/:kanbanViewId', '/api/v2/meta/kanbans/:kanbanViewId',
]) ])
@Acl('kanbanViewUpdate') @Acl('kanbanViewUpdate')
async kanbanViewUpdate( async kanbanViewUpdate(

6
packages/nocodb/src/controllers/maps.controller.ts

@ -20,7 +20,7 @@ import { MetaApiLimiterGuard } from '~/guards/meta-api-limiter.guard';
export class MapsController { export class MapsController {
constructor(private readonly mapsService: MapsService) {} constructor(private readonly mapsService: MapsService) {}
@Get(['/api/v1/db/meta/maps/:mapViewId', '/api/v1/meta/maps/:mapViewId']) @Get(['/api/v1/db/meta/maps/:mapViewId', '/api/v2/meta/maps/:mapViewId'])
@Acl('mapViewGet') @Acl('mapViewGet')
async mapViewGet(@Param('mapViewId') mapViewId: string) { async mapViewGet(@Param('mapViewId') mapViewId: string) {
return await this.mapsService.mapViewGet({ mapViewId }); return await this.mapsService.mapViewGet({ mapViewId });
@ -28,7 +28,7 @@ export class MapsController {
@Post([ @Post([
'/api/v1/db/meta/tables/:tableId/maps', '/api/v1/db/meta/tables/:tableId/maps',
'/api/v1/meta/tables/:tableId/maps', '/api/v2/meta/tables/:tableId/maps',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('mapViewCreate') @Acl('mapViewCreate')
@ -45,7 +45,7 @@ export class MapsController {
return view; return view;
} }
@Patch(['/api/v1/db/meta/maps/:mapViewId', '/api/v1/meta/maps/:mapViewId']) @Patch(['/api/v1/db/meta/maps/:mapViewId', '/api/v2/meta/maps/:mapViewId'])
@Acl('mapViewUpdate') @Acl('mapViewUpdate')
async mapViewUpdate( async mapViewUpdate(
@Param('mapViewId') mapViewId: string, @Param('mapViewId') mapViewId: string,

4
packages/nocodb/src/controllers/meta-diffs.controller.ts

@ -11,7 +11,7 @@ export class MetaDiffsController {
@Get([ @Get([
'/api/v1/db/meta/projects/:baseId/meta-diff', '/api/v1/db/meta/projects/:baseId/meta-diff',
'/api/v1/meta/bases/:baseId/meta-diff', '/api/v2/meta/bases/:baseId/meta-diff',
]) ])
@Acl('metaDiff') @Acl('metaDiff')
async metaDiff(@Param('baseId') baseId: string) { async metaDiff(@Param('baseId') baseId: string) {
@ -20,7 +20,7 @@ export class MetaDiffsController {
@Get([ @Get([
'/api/v1/db/meta/projects/:baseId/meta-diff/:sourceId', '/api/v1/db/meta/projects/:baseId/meta-diff/:sourceId',
'/api/v1/meta/bases/:baseId/meta-diff/:sourceId', '/api/v2/meta/bases/:baseId/meta-diff/:sourceId',
]) ])
@Acl('metaDiff') @Acl('metaDiff')
async baseMetaDiff( async baseMetaDiff(

4
packages/nocodb/src/controllers/model-visibilities.controller.ts

@ -22,7 +22,7 @@ export class ModelVisibilitiesController {
@Post([ @Post([
'/api/v1/db/meta/projects/:baseId/visibility-rules', '/api/v1/db/meta/projects/:baseId/visibility-rules',
'/api/v1/meta/bases/:baseId/visibility-rules', '/api/v2/meta/bases/:baseId/visibility-rules',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('modelVisibilitySet') @Acl('modelVisibilitySet')
@ -40,7 +40,7 @@ export class ModelVisibilitiesController {
@Get([ @Get([
'/api/v1/db/meta/projects/:baseId/visibility-rules', '/api/v1/db/meta/projects/:baseId/visibility-rules',
'/api/v1/meta/bases/:baseId/visibility-rules', '/api/v2/meta/bases/:baseId/visibility-rules',
]) ])
@Acl('modelVisibilityList') @Acl('modelVisibilityList')
async modelVisibilityList( async modelVisibilityList(

12
packages/nocodb/src/controllers/plugins.controller.ts

@ -26,7 +26,7 @@ import { MetaApiLimiterGuard } from '~/guards/meta-api-limiter.guard';
export class PluginsController { export class PluginsController {
constructor(private readonly pluginsService: PluginsService) {} constructor(private readonly pluginsService: PluginsService) {}
@Get(['/api/v1/db/meta/plugins', '/api/v1/meta/plugins']) @Get(['/api/v1/db/meta/plugins', '/api/v2/meta/plugins'])
@Acl('pluginList', { @Acl('pluginList', {
scope: 'org', scope: 'org',
}) })
@ -34,7 +34,7 @@ export class PluginsController {
return new PagedResponseImpl(await this.pluginsService.pluginList()); return new PagedResponseImpl(await this.pluginsService.pluginList());
} }
@Get(['/api/v1/db/meta/plugins/webhook', '/api/v1/meta/plugins/webhook']) @Get(['/api/v1/db/meta/plugins/webhook', '/api/v2/meta/plugins/webhook'])
@Acl('webhookPluginList', { @Acl('webhookPluginList', {
scope: 'org', scope: 'org',
}) })
@ -42,7 +42,7 @@ export class PluginsController {
return new PagedResponseImpl(await this.pluginsService.webhookPluginList()); return new PagedResponseImpl(await this.pluginsService.webhookPluginList());
} }
@Post(['/api/v1/db/meta/plugins/test', '/api/v1/meta/plugins/test']) @Post(['/api/v1/db/meta/plugins/test', '/api/v2/meta/plugins/test'])
@HttpCode(200) @HttpCode(200)
@Acl('pluginTest', { @Acl('pluginTest', {
scope: 'org', scope: 'org',
@ -51,7 +51,7 @@ export class PluginsController {
return await this.pluginsService.pluginTest({ body: body }); return await this.pluginsService.pluginTest({ body: body });
} }
@Get(['/api/v1/db/meta/plugins/:pluginId', '/api/v1/meta/plugins/:pluginId']) @Get(['/api/v1/db/meta/plugins/:pluginId', '/api/v2/meta/plugins/:pluginId'])
@Acl('pluginRead', { @Acl('pluginRead', {
scope: 'org', scope: 'org',
}) })
@ -61,7 +61,7 @@ export class PluginsController {
@Patch([ @Patch([
'/api/v1/db/meta/plugins/:pluginId', '/api/v1/db/meta/plugins/:pluginId',
'/api/v1/meta/plugins/:pluginId', '/api/v2/meta/plugins/:pluginId',
]) ])
@Acl('pluginUpdate', { @Acl('pluginUpdate', {
scope: 'org', scope: 'org',
@ -76,7 +76,7 @@ export class PluginsController {
@Get([ @Get([
'/api/v1/db/meta/plugins/:pluginTitle/status', '/api/v1/db/meta/plugins/:pluginTitle/status',
'/api/v1/meta/plugins/:pluginTitle/status', '/api/v2/meta/plugins/:pluginTitle/status',
]) ])
@Acl('isPluginActive', { @Acl('isPluginActive', {
scope: 'org', scope: 'org',

4
packages/nocodb/src/controllers/public-datas-export.controller.ts

@ -27,7 +27,7 @@ export class PublicDatasExportController {
@Get([ @Get([
'/api/v1/db/public/shared-view/:publicDataUuid/rows/export/excel', '/api/v1/db/public/shared-view/:publicDataUuid/rows/export/excel',
'/api/v1/public/shared-view/:publicDataUuid/rows/export/excel', '/api/v2/public/shared-view/:publicDataUuid/rows/export/excel',
]) ])
async exportExcel( async exportExcel(
@Request() req, @Request() req,
@ -82,7 +82,7 @@ export class PublicDatasExportController {
@Get([ @Get([
'/api/v1/db/public/shared-view/:publicDataUuid/rows/export/csv', '/api/v1/db/public/shared-view/:publicDataUuid/rows/export/csv',
'/api/v1/public/shared-view/:publicDataUuid/rows/export/csv', '/api/v2/public/shared-view/:publicDataUuid/rows/export/csv',
]) ])
async exportCsv(@Request() req, @Response() res) { async exportCsv(@Request() req, @Response() res) {
const view = await View.getByUUID(req.params.publicDataUuid); const view = await View.getByUUID(req.params.publicDataUuid);

14
packages/nocodb/src/controllers/public-datas.controller.ts

@ -19,7 +19,7 @@ export class PublicDatasController {
@Get([ @Get([
'/api/v1/db/public/shared-view/:sharedViewUuid/rows', '/api/v1/db/public/shared-view/:sharedViewUuid/rows',
'/api/v1/public/shared-view/:sharedViewUuid/rows', '/api/v2/public/shared-view/:sharedViewUuid/rows',
]) ])
async dataList( async dataList(
@Request() req, @Request() req,
@ -35,7 +35,7 @@ export class PublicDatasController {
@Get([ @Get([
'/api/v1/db/public/shared-view/:sharedViewUuid/groupby', '/api/v1/db/public/shared-view/:sharedViewUuid/groupby',
'/api/v1/public/shared-view/:sharedViewUuid/groupby', '/api/v2/public/shared-view/:sharedViewUuid/groupby',
]) ])
async dataGroupBy( async dataGroupBy(
@Request() req, @Request() req,
@ -50,7 +50,7 @@ export class PublicDatasController {
@Get([ @Get([
'/api/v1/db/public/shared-view/:sharedViewUuid/group/:columnId', '/api/v1/db/public/shared-view/:sharedViewUuid/group/:columnId',
'/api/v1/public/shared-view/:sharedViewUuid/group/:columnId', '/api/v2/public/shared-view/:sharedViewUuid/group/:columnId',
]) ])
async groupedDataList( async groupedDataList(
@Request() req, @Request() req,
@ -68,7 +68,7 @@ export class PublicDatasController {
@Post([ @Post([
'/api/v1/db/public/shared-view/:sharedViewUuid/rows', '/api/v1/db/public/shared-view/:sharedViewUuid/rows',
'/api/v1/public/shared-view/:sharedViewUuid/rows', '/api/v2/public/shared-view/:sharedViewUuid/rows',
]) ])
@HttpCode(200) @HttpCode(200)
@UseInterceptors(AnyFilesInterceptor()) @UseInterceptors(AnyFilesInterceptor())
@ -89,7 +89,7 @@ export class PublicDatasController {
@Get([ @Get([
'/api/v1/db/public/shared-view/:sharedViewUuid/nested/:columnId', '/api/v1/db/public/shared-view/:sharedViewUuid/nested/:columnId',
'/api/v1/public/shared-view/:sharedViewUuid/nested/:columnId', '/api/v2/public/shared-view/:sharedViewUuid/nested/:columnId',
]) ])
async relDataList( async relDataList(
@Request() req, @Request() req,
@ -108,7 +108,7 @@ export class PublicDatasController {
@Get([ @Get([
'/api/v1/db/public/shared-view/:sharedViewUuid/rows/:rowId/mm/:columnId', '/api/v1/db/public/shared-view/:sharedViewUuid/rows/:rowId/mm/:columnId',
'/api/v1/public/shared-view/:sharedViewUuid/rows/:rowId/mm/:columnId', '/api/v2/public/shared-view/:sharedViewUuid/rows/:rowId/mm/:columnId',
]) ])
async publicMmList( async publicMmList(
@Request() req, @Request() req,
@ -128,7 +128,7 @@ export class PublicDatasController {
@Get([ @Get([
'/api/v1/db/public/shared-view/:sharedViewUuid/rows/:rowId/hm/:columnId', '/api/v1/db/public/shared-view/:sharedViewUuid/rows/:rowId/hm/:columnId',
'/api/v1/public/shared-view/:sharedViewUuid/rows/:rowId/hm/:columnId', '/api/v2/public/shared-view/:sharedViewUuid/rows/:rowId/hm/:columnId',
]) ])
async publicHmList( async publicHmList(
@Request() req, @Request() req,

4
packages/nocodb/src/controllers/public-metas.controller.ts

@ -9,7 +9,7 @@ export class PublicMetasController {
@Get([ @Get([
'/api/v1/db/public/shared-view/:sharedViewUuid/meta', '/api/v1/db/public/shared-view/:sharedViewUuid/meta',
'/api/v1/public/shared-view/:sharedViewUuid/meta', '/api/v2/public/shared-view/:sharedViewUuid/meta',
]) ])
async viewMetaGet( async viewMetaGet(
@Request() req, @Request() req,
@ -23,7 +23,7 @@ export class PublicMetasController {
@Get([ @Get([
'/api/v1/db/public/shared-base/:sharedBaseUuid/meta', '/api/v1/db/public/shared-base/:sharedBaseUuid/meta',
'/api/v1/public/shared-base/:sharedBaseUuid/meta', '/api/v2/public/shared-base/:sharedBaseUuid/meta',
]) ])
async publicSharedBaseGet( async publicSharedBaseGet(
@Param('sharedBaseUuid') sharedBaseUuid: string, @Param('sharedBaseUuid') sharedBaseUuid: string,

8
packages/nocodb/src/controllers/shared-bases.controller.ts

@ -22,7 +22,7 @@ export class SharedBasesController {
@Post([ @Post([
'/api/v1/db/meta/projects/:baseId/shared', '/api/v1/db/meta/projects/:baseId/shared',
'/api/v1/meta/bases/:baseId/shared', '/api/v2/meta/bases/:baseId/shared',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('createSharedBaseLink') @Acl('createSharedBaseLink')
@ -43,7 +43,7 @@ export class SharedBasesController {
@Patch([ @Patch([
'/api/v1/db/meta/projects/:baseId/shared', '/api/v1/db/meta/projects/:baseId/shared',
'/api/v1/meta/bases/:baseId/shared', '/api/v2/meta/bases/:baseId/shared',
]) ])
@Acl('updateSharedBaseLink') @Acl('updateSharedBaseLink')
async updateSharedBaseLink( async updateSharedBaseLink(
@ -63,7 +63,7 @@ export class SharedBasesController {
@Delete([ @Delete([
'/api/v1/db/meta/projects/:baseId/shared', '/api/v1/db/meta/projects/:baseId/shared',
'/api/v1/meta/bases/:baseId/shared', '/api/v2/meta/bases/:baseId/shared',
]) ])
@Acl('disableSharedBaseLink') @Acl('disableSharedBaseLink')
async disableSharedBaseLink(@Param('baseId') baseId: string): Promise<any> { async disableSharedBaseLink(@Param('baseId') baseId: string): Promise<any> {
@ -76,7 +76,7 @@ export class SharedBasesController {
@Get([ @Get([
'/api/v1/db/meta/projects/:baseId/shared', '/api/v1/db/meta/projects/:baseId/shared',
'/api/v1/meta/bases/:baseId/shared', '/api/v2/meta/bases/:baseId/shared',
]) ])
@Acl('getSharedBaseLink') @Acl('getSharedBaseLink')
async getSharedBaseLink( async getSharedBaseLink(

10
packages/nocodb/src/controllers/sorts.controller.ts

@ -24,7 +24,7 @@ export class SortsController {
@Get([ @Get([
'/api/v1/db/meta/views/:viewId/sorts/', '/api/v1/db/meta/views/:viewId/sorts/',
'/api/v1/meta/views/:viewId/sorts/', '/api/v2/meta/views/:viewId/sorts/',
]) ])
@Acl('sortList') @Acl('sortList')
async sortList(@Param('viewId') viewId: string) { async sortList(@Param('viewId') viewId: string) {
@ -37,7 +37,7 @@ export class SortsController {
@Post([ @Post([
'/api/v1/db/meta/views/:viewId/sorts/', '/api/v1/db/meta/views/:viewId/sorts/',
'/api/v1/meta/views/:viewId/sorts/', '/api/v2/meta/views/:viewId/sorts/',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('sortCreate') @Acl('sortCreate')
@ -53,7 +53,7 @@ export class SortsController {
return sort; return sort;
} }
@Get(['/api/v1/db/meta/sorts/:sortId', '/api/v1/meta/sorts/:sortId']) @Get(['/api/v1/db/meta/sorts/:sortId', '/api/v2/meta/sorts/:sortId'])
@Acl('sortGet') @Acl('sortGet')
async sortGet(@Param('sortId') sortId: string) { async sortGet(@Param('sortId') sortId: string) {
const sort = await this.sortsService.sortGet({ const sort = await this.sortsService.sortGet({
@ -62,7 +62,7 @@ export class SortsController {
return sort; return sort;
} }
@Patch(['/api/v1/db/meta/sorts/:sortId', '/api/v1/meta/sorts/:sortId']) @Patch(['/api/v1/db/meta/sorts/:sortId', '/api/v2/meta/sorts/:sortId'])
@Acl('sortUpdate') @Acl('sortUpdate')
async sortUpdate( async sortUpdate(
@Param('sortId') sortId: string, @Param('sortId') sortId: string,
@ -76,7 +76,7 @@ export class SortsController {
return sort; return sort;
} }
@Delete(['/api/v1/db/meta/sorts/:sortId', '/api/v1/meta/sorts/:sortId']) @Delete(['/api/v1/db/meta/sorts/:sortId', '/api/v2/meta/sorts/:sortId'])
@Acl('sortDelete') @Acl('sortDelete')
async sortDelete(@Param('sortId') sortId: string, @Req() _req) { async sortDelete(@Param('sortId') sortId: string, @Req() _req) {
const sort = await this.sortsService.sortDelete({ const sort = await this.sortsService.sortDelete({

6
packages/nocodb/src/controllers/sources.controller.ts

@ -13,7 +13,7 @@ export class SourcesController {
@Get([ @Get([
'/api/v1/db/meta/projects/:baseId/bases/:sourceId', '/api/v1/db/meta/projects/:baseId/bases/:sourceId',
'/api/v1/meta/bases/:baseId/sources/:sourceId', '/api/v2/meta/bases/:baseId/sources/:sourceId',
]) ])
@Acl('baseGet') @Acl('baseGet')
async baseGet(@Param('sourceId') sourceId: string) { async baseGet(@Param('sourceId') sourceId: string) {
@ -30,7 +30,7 @@ export class SourcesController {
@Patch([ @Patch([
'/api/v1/db/meta/projects/:baseId/bases/:sourceId', '/api/v1/db/meta/projects/:baseId/bases/:sourceId',
'/api/v1/meta/bases/:baseId/sources/:sourceId', '/api/v2/meta/bases/:baseId/sources/:sourceId',
]) ])
@Acl('baseUpdate') @Acl('baseUpdate')
async baseUpdate( async baseUpdate(
@ -49,7 +49,7 @@ export class SourcesController {
@Get([ @Get([
'/api/v1/db/meta/projects/:baseId/bases', '/api/v1/db/meta/projects/:baseId/bases',
'/api/v1/meta/bases/:baseId/sources', '/api/v2/meta/bases/:baseId/sources',
]) ])
@Acl('baseList') @Acl('baseList')
async baseList(@Param('baseId') baseId: string) { async baseList(@Param('baseId') baseId: string) {

2
packages/nocodb/src/controllers/sql-views.controller.ts

@ -18,7 +18,7 @@ export class SqlViewsController {
@Post([ @Post([
'/api/v1/db/meta/projects/:baseId/bases/:sourceId/sqlView', '/api/v1/db/meta/projects/:baseId/bases/:sourceId/sqlView',
'/api/v1/meta/bases/:baseId/sources/:sourceId/sqlView', '/api/v2/meta/bases/:baseId/sources/:sourceId/sqlView',
]) ])
@Acl('sqlViewCreate') @Acl('sqlViewCreate')
async sqlViewCreate( async sqlViewCreate(

12
packages/nocodb/src/controllers/sync.controller.ts

@ -23,8 +23,8 @@ export class SyncController {
@Get([ @Get([
'/api/v1/db/meta/projects/:baseId/syncs', '/api/v1/db/meta/projects/:baseId/syncs',
'/api/v1/db/meta/projects/:baseId/syncs/:sourceId', '/api/v1/db/meta/projects/:baseId/syncs/:sourceId',
'/api/v1/meta/bases/:baseId/syncs', '/api/v2/meta/bases/:baseId/syncs',
'/api/v1/meta/bases/:baseId/syncs/:sourceId', '/api/v2/meta/bases/:baseId/syncs/:sourceId',
]) ])
@Acl('syncSourceList') @Acl('syncSourceList')
async syncSourceList( async syncSourceList(
@ -40,8 +40,8 @@ export class SyncController {
@Post([ @Post([
'/api/v1/db/meta/projects/:baseId/syncs', '/api/v1/db/meta/projects/:baseId/syncs',
'/api/v1/db/meta/projects/:baseId/syncs/:sourceId', '/api/v1/db/meta/projects/:baseId/syncs/:sourceId',
'/api/v1/meta/bases/:baseId/syncs', '/api/v2/meta/bases/:baseId/syncs',
'/api/v1/meta/bases/:baseId/syncs/:sourceId', '/api/v2/meta/bases/:baseId/syncs/:sourceId',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('syncSourceCreate') @Acl('syncSourceCreate')
@ -59,7 +59,7 @@ export class SyncController {
}); });
} }
@Delete(['/api/v1/db/meta/syncs/:syncId', '/api/v1/meta/syncs/:syncId']) @Delete(['/api/v1/db/meta/syncs/:syncId', '/api/v2/meta/syncs/:syncId'])
@Acl('syncSourceDelete') @Acl('syncSourceDelete')
async syncDelete(@Param('syncId') syncId: string) { async syncDelete(@Param('syncId') syncId: string) {
return await this.syncService.syncDelete({ return await this.syncService.syncDelete({
@ -67,7 +67,7 @@ export class SyncController {
}); });
} }
@Patch(['/api/v1/db/meta/syncs/:syncId', '/api/v1/meta/syncs/:syncId']) @Patch(['/api/v1/db/meta/syncs/:syncId', '/api/v2/meta/syncs/:syncId'])
@Acl('syncSourceUpdate') @Acl('syncSourceUpdate')
async syncUpdate(@Param('syncId') syncId: string, @Body() body: any) { async syncUpdate(@Param('syncId') syncId: string, @Body() body: any) {
return await this.syncService.syncUpdate({ return await this.syncService.syncUpdate({

16
packages/nocodb/src/controllers/tables.controller.ts

@ -26,8 +26,8 @@ export class TablesController {
@Get([ @Get([
'/api/v1/db/meta/projects/:baseId/tables', '/api/v1/db/meta/projects/:baseId/tables',
'/api/v1/db/meta/projects/:baseId/:sourceId/tables', '/api/v1/db/meta/projects/:baseId/:sourceId/tables',
'/api/v1/meta/bases/:baseId/tables', '/api/v2/meta/bases/:baseId/tables',
'/api/v1/meta/bases/:baseId/:sourceId/tables', '/api/v2/meta/bases/:baseId/:sourceId/tables',
]) ])
@Acl('tableList') @Acl('tableList')
async tableList( async tableList(
@ -49,8 +49,8 @@ export class TablesController {
@Post([ @Post([
'/api/v1/db/meta/projects/:baseId/tables', '/api/v1/db/meta/projects/:baseId/tables',
'/api/v1/db/meta/projects/:baseId/:sourceId/tables', '/api/v1/db/meta/projects/:baseId/:sourceId/tables',
'/api/v1/meta/bases/:baseId/tables', '/api/v2/meta/bases/:baseId/tables',
'/api/v1/meta/bases/:baseId/:sourceId/tables', '/api/v2/meta/bases/:baseId/:sourceId/tables',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('tableCreate') @Acl('tableCreate')
@ -70,7 +70,7 @@ export class TablesController {
return result; return result;
} }
@Get(['/api/v1/db/meta/tables/:tableId', '/api/v1/meta/tables/:tableId']) @Get(['/api/v1/db/meta/tables/:tableId', '/api/v2/meta/tables/:tableId'])
@Acl('tableGet') @Acl('tableGet')
async tableGet(@Param('tableId') tableId: string, @Request() req) { async tableGet(@Param('tableId') tableId: string, @Request() req) {
const table = await this.tablesService.getTableWithAccessibleViews({ const table = await this.tablesService.getTableWithAccessibleViews({
@ -81,7 +81,7 @@ export class TablesController {
return table; return table;
} }
@Patch(['/api/v1/db/meta/tables/:tableId', '/api/v1/meta/tables/:tableId']) @Patch(['/api/v1/db/meta/tables/:tableId', '/api/v2/meta/tables/:tableId'])
@Acl('tableUpdate') @Acl('tableUpdate')
async tableUpdate( async tableUpdate(
@Param('tableId') tableId: string, @Param('tableId') tableId: string,
@ -97,7 +97,7 @@ export class TablesController {
return { msg: 'The table has been updated successfully' }; return { msg: 'The table has been updated successfully' };
} }
@Delete(['/api/v1/db/meta/tables/:tableId', '/api/v1/meta/tables/:tableId']) @Delete(['/api/v1/db/meta/tables/:tableId', '/api/v2/meta/tables/:tableId'])
@Acl('tableDelete') @Acl('tableDelete')
async tableDelete(@Param('tableId') tableId: string, @Request() req) { async tableDelete(@Param('tableId') tableId: string, @Request() req) {
const result = await this.tablesService.tableDelete({ const result = await this.tablesService.tableDelete({
@ -111,7 +111,7 @@ export class TablesController {
@Post([ @Post([
'/api/v1/db/meta/tables/:tableId/reorder', '/api/v1/db/meta/tables/:tableId/reorder',
'/api/v1/meta/tables/:tableId/reorder', '/api/v2/meta/tables/:tableId/reorder',
]) ])
@Acl('tableReorder') @Acl('tableReorder')
@HttpCode(200) @HttpCode(200)

6
packages/nocodb/src/controllers/utils.controller.ts

@ -39,7 +39,7 @@ export class UtilsController {
} }
@UseGuards(MetaApiLimiterGuard, GlobalGuard) @UseGuards(MetaApiLimiterGuard, GlobalGuard)
@Post(['/api/v1/db/meta/connection/test', '/api/v1/meta/connection/test']) @Post(['/api/v1/db/meta/connection/test', '/api/v2/meta/connection/test'])
@Acl('testConnection', { @Acl('testConnection', {
scope: 'org', scope: 'org',
}) })
@ -49,7 +49,7 @@ export class UtilsController {
} }
@UseGuards(PublicApiLimiterGuard) @UseGuards(PublicApiLimiterGuard)
@Get(['/api/v1/db/meta/nocodb/info', '/api/v1/meta/nocodb/info']) @Get(['/api/v1/db/meta/nocodb/info', '/api/v2/meta/nocodb/info'])
async appInfo(@Request() req) { async appInfo(@Request() req) {
return await this.utilsService.appInfo({ return await this.utilsService.appInfo({
req: { req: {
@ -65,7 +65,7 @@ export class UtilsController {
} }
@UseGuards(PublicApiLimiterGuard) @UseGuards(PublicApiLimiterGuard)
@Post(['/api/v1/db/meta/axiosRequestMake', '/api/v1/meta/axiosRequestMake']) @Post(['/api/v1/db/meta/axiosRequestMake', '/api/v2/meta/axiosRequestMake'])
@HttpCode(200) @HttpCode(200)
async axiosRequestMake(@Body() body: any) { async axiosRequestMake(@Body() body: any) {
return await this.utilsService.axiosRequestMake({ body }); return await this.utilsService.axiosRequestMake({ body });

6
packages/nocodb/src/controllers/view-columns.controller.ts

@ -22,7 +22,7 @@ export class ViewColumnsController {
@Get([ @Get([
'/api/v1/db/meta/views/:viewId/columns/', '/api/v1/db/meta/views/:viewId/columns/',
'/api/v1/meta/views/:viewId/columns/', '/api/v2/meta/views/:viewId/columns/',
]) ])
@Acl('columnList') @Acl('columnList')
async columnList(@Param('viewId') viewId: string) { async columnList(@Param('viewId') viewId: string) {
@ -35,7 +35,7 @@ export class ViewColumnsController {
@Post([ @Post([
'/api/v1/db/meta/views/:viewId/columns/', '/api/v1/db/meta/views/:viewId/columns/',
'/api/v1/meta/views/:viewId/columns/', '/api/v2/meta/views/:viewId/columns/',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('columnAdd') @Acl('columnAdd')
@ -52,7 +52,7 @@ export class ViewColumnsController {
@Patch([ @Patch([
'/api/v1/db/meta/views/:viewId/columns/:columnId', '/api/v1/db/meta/views/:viewId/columns/:columnId',
'/api/v1/meta/views/:viewId/columns/:columnId', '/api/v2/meta/views/:viewId/columns/:columnId',
]) ])
@Acl('columnUpdate') @Acl('columnUpdate')
async columnUpdate( async columnUpdate(

18
packages/nocodb/src/controllers/views.controller.ts

@ -25,7 +25,7 @@ export class ViewsController {
@Get([ @Get([
'/api/v1/db/meta/tables/:tableId/views', '/api/v1/db/meta/tables/:tableId/views',
'/api/v1/meta/tables/:tableId/views', '/api/v2/meta/tables/:tableId/views',
]) ])
@Acl('viewList') @Acl('viewList')
async viewList(@Param('tableId') tableId: string, @Request() req) { async viewList(@Param('tableId') tableId: string, @Request() req) {
@ -37,7 +37,7 @@ export class ViewsController {
); );
} }
@Patch(['/api/v1/db/meta/views/:viewId', '/api/v1/meta/views/:viewId']) @Patch(['/api/v1/db/meta/views/:viewId', '/api/v2/meta/views/:viewId'])
@Acl('viewUpdate') @Acl('viewUpdate')
async viewUpdate( async viewUpdate(
@Param('viewId') viewId: string, @Param('viewId') viewId: string,
@ -52,7 +52,7 @@ export class ViewsController {
return result; return result;
} }
@Delete(['/api/v1/db/meta/views/:viewId', '/api/v1/meta/views/:viewId']) @Delete(['/api/v1/db/meta/views/:viewId', '/api/v2/meta/views/:viewId'])
@Acl('viewDelete') @Acl('viewDelete')
async viewDelete(@Param('viewId') viewId: string, @Request() req) { async viewDelete(@Param('viewId') viewId: string, @Request() req) {
const result = await this.viewsService.viewDelete({ const result = await this.viewsService.viewDelete({
@ -64,7 +64,7 @@ export class ViewsController {
@Post([ @Post([
'/api/v1/db/meta/views/:viewId/show-all', '/api/v1/db/meta/views/:viewId/show-all',
'/api/v1/meta/views/:viewId/show-all', '/api/v2/meta/views/:viewId/show-all',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('showAllColumns') @Acl('showAllColumns')
@ -79,7 +79,7 @@ export class ViewsController {
} }
@Post([ @Post([
'/api/v1/db/meta/views/:viewId/hide-all', '/api/v1/db/meta/views/:viewId/hide-all',
'/api/v1/meta/views/:viewId/hide-all', '/api/v2/meta/views/:viewId/hide-all',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('hideAllColumns') @Acl('hideAllColumns')
@ -95,7 +95,7 @@ export class ViewsController {
@Post([ @Post([
'/api/v1/db/meta/views/:viewId/share', '/api/v1/db/meta/views/:viewId/share',
'/api/v1/meta/views/:viewId/share', '/api/v2/meta/views/:viewId/share',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('shareView') @Acl('shareView')
@ -105,7 +105,7 @@ export class ViewsController {
@Get([ @Get([
'/api/v1/db/meta/tables/:tableId/share', '/api/v1/db/meta/tables/:tableId/share',
'/api/v1/meta/tables/:tableId/share', '/api/v2/meta/tables/:tableId/share',
]) ])
@Acl('shareViewList') @Acl('shareViewList')
async shareViewList(@Param('tableId') tableId: string) { async shareViewList(@Param('tableId') tableId: string) {
@ -118,7 +118,7 @@ export class ViewsController {
@Patch([ @Patch([
'/api/v1/db/meta/views/:viewId/share', '/api/v1/db/meta/views/:viewId/share',
'/api/v1/meta/views/:viewId/share', '/api/v2/meta/views/:viewId/share',
]) ])
@Acl('shareViewUpdate') @Acl('shareViewUpdate')
async shareViewUpdate( async shareViewUpdate(
@ -135,7 +135,7 @@ export class ViewsController {
@Delete([ @Delete([
'/api/v1/db/meta/views/:viewId/share', '/api/v1/db/meta/views/:viewId/share',
'/api/v1/meta/views/:viewId/share', '/api/v2/meta/views/:viewId/share',
]) ])
@Acl('shareViewDelete') @Acl('shareViewDelete')
async shareViewDelete(@Param('viewId') viewId: string, @Request() req) { async shareViewDelete(@Param('viewId') viewId: string, @Request() req) {

11
packages/nocodb/src/middlewares/extract-ids/extract-ids.middleware.ts

@ -128,8 +128,8 @@ export class ExtractIdsMiddleware implements NestMiddleware, CanActivate {
[ [
'/api/v1/db/meta/audits/rows/:rowId/update', '/api/v1/db/meta/audits/rows/:rowId/update',
'/api/v1/db/meta/audits/comments', '/api/v1/db/meta/audits/comments',
'/api/v1/meta/audits/rows/:rowId/update', '/api/v2/meta/audits/rows/:rowId/update',
'/api/v1/meta/audits/comments', '/api/v2/meta/audits/comments',
].some( ].some(
(auditInsertOrUpdatePath) => req.route.path === auditInsertOrUpdatePath, (auditInsertOrUpdatePath) => req.route.path === auditInsertOrUpdatePath,
) && ) &&
@ -146,8 +146,8 @@ export class ExtractIdsMiddleware implements NestMiddleware, CanActivate {
[ [
'/api/v1/db/meta/audits/comments/count', '/api/v1/db/meta/audits/comments/count',
'/api/v1/db/meta/audits/comments', '/api/v1/db/meta/audits/comments',
'/api/v1/meta/audits/comments/count', '/api/v2/meta/audits/comments/count',
'/api/v1/meta/audits/comments', '/api/v2/meta/audits/comments',
].some((auditReadPath) => req.route.path === auditReadPath) && ].some((auditReadPath) => req.route.path === auditReadPath) &&
req.method === 'GET' && req.method === 'GET' &&
req.query.fk_model_id req.query.fk_model_id
@ -163,9 +163,8 @@ export class ExtractIdsMiddleware implements NestMiddleware, CanActivate {
'/auth/user/me', '/auth/user/me',
'/api/v1/db/auth/user/me', '/api/v1/db/auth/user/me',
'/api/v1/auth/user/me', '/api/v1/auth/user/me',
'/api/v1/auth/user/me',
'/api/v1/db/meta/plugins/webhook', '/api/v1/db/meta/plugins/webhook',
'/api/v1/meta/plugins/webhook', '/api/v2/meta/plugins/webhook',
].some((userMePath) => req.route.path === userMePath) && ].some((userMePath) => req.route.path === userMePath) &&
req.query.base_id req.query.base_id
) { ) {

4
packages/nocodb/src/modules/jobs/jobs/at-import/at-import.controller.ts

@ -20,7 +20,7 @@ export class AtImportController {
@Post([ @Post([
'/api/v1/db/meta/syncs/:syncId/trigger', '/api/v1/db/meta/syncs/:syncId/trigger',
'/api/v1/meta/syncs/:syncId/trigger', '/api/v2/meta/syncs/:syncId/trigger',
]) ])
@Acl('airtableImport') @Acl('airtableImport')
@HttpCode(200) @HttpCode(200)
@ -60,7 +60,7 @@ export class AtImportController {
@Post([ @Post([
'/api/v1/db/meta/syncs/:syncId/abort', '/api/v1/db/meta/syncs/:syncId/abort',
'/api/v1/meta/syncs/:syncId/abort', '/api/v2/meta/syncs/:syncId/abort',
]) ])
@Acl('airtableImport') @Acl('airtableImport')
@HttpCode(200) @HttpCode(200)

4
packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.controller.ts

@ -94,7 +94,7 @@ export class DuplicateController {
@Post([ @Post([
'/api/v1/db/meta/duplicate/:baseId/:sourceId?', '/api/v1/db/meta/duplicate/:baseId/:sourceId?',
'/api/v1/meta/duplicate/:baseId/:sourceId?', '/api/v2/meta/duplicate/:baseId/:sourceId?',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('duplicateBase') @Acl('duplicateBase')
@ -159,7 +159,7 @@ export class DuplicateController {
@Post([ @Post([
'/api/v1/db/meta/duplicate/:baseId/table/:modelId', '/api/v1/db/meta/duplicate/:baseId/table/:modelId',
'/api/v1/meta/duplicate/:baseId/table/:modelId', '/api/v2/meta/duplicate/:baseId/table/:modelId',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('duplicateModel') @Acl('duplicateModel')

4
packages/nocodb/src/modules/jobs/jobs/meta-sync/meta-sync.controller.ts

@ -20,7 +20,7 @@ export class MetaSyncController {
@Post([ @Post([
'/api/v1/db/meta/projects/:baseId/meta-diff', '/api/v1/db/meta/projects/:baseId/meta-diff',
'/api/v1/meta/bases/:baseId/meta-diff', '/api/v2/meta/bases/:baseId/meta-diff',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('metaDiffSync') @Acl('metaDiffSync')
@ -45,7 +45,7 @@ export class MetaSyncController {
@Post([ @Post([
'/api/v1/db/meta/projects/:baseId/meta-diff/:sourceId', '/api/v1/db/meta/projects/:baseId/meta-diff/:sourceId',
'/api/v1/meta/bases/:baseId/meta-diff/:sourceId', '/api/v2/meta/bases/:baseId/meta-diff/:sourceId',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('baseMetaDiffSync') @Acl('baseMetaDiffSync')

4
packages/nocodb/src/modules/jobs/jobs/source-create/source-create.controller.ts

@ -20,8 +20,8 @@ export class SourceCreateController {
constructor(@Inject('JobsService') private readonly jobsService) {} constructor(@Inject('JobsService') private readonly jobsService) {}
@Post([ @Post([
'/api/v1/db/meta/projects/:baseId/sources', '/api/v1/db/meta/projects/:baseId/bases',
'/api/v1/meta/bases/:baseId/sources', '/api/v2/meta/bases/:baseId/sources',
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('baseCreate') @Acl('baseCreate')

2
packages/nocodb/src/modules/jobs/jobs/source-delete/source-delete.controller.ts

@ -16,7 +16,7 @@ export class SourceDeleteController {
@Delete([ @Delete([
'/api/v1/db/meta/projects/:baseId/bases/:sourceId', '/api/v1/db/meta/projects/:baseId/bases/:sourceId',
'/api/v1/meta/bases/:baseId/sources/:sourceId', '/api/v2/meta/bases/:baseId/sources/:sourceId',
]) ])
@Acl('baseDelete') @Acl('baseDelete')
async baseDelete(@Param('sourceId') sourceId: string) { async baseDelete(@Param('sourceId') sourceId: string) {

20308
packages/nocodb/src/schema/swagger-v2.json

File diff suppressed because it is too large Load Diff

218
packages/nocodb/src/schema/swagger.json

@ -1686,7 +1686,7 @@
] ]
} }
}, },
"/api/v1/meta/bases/{baseId}/users": { "/api/v1/db/meta/projects/{baseId}/users": {
"get": { "get": {
"summary": "List Base Users", "summary": "List Base Users",
"operationId": "auth-base-user-list", "operationId": "auth-base-user-list",
@ -1897,7 +1897,7 @@
] ]
} }
}, },
"/api/v1/meta/bases/{baseId}/info": { "/api/v1/db/meta/projects/{baseId}/info": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -1996,7 +1996,7 @@
] ]
} }
}, },
"/api/v1/meta/bases/{baseId}/users/{userId}": { "/api/v1/db/meta/projects/{baseId}/users/{userId}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -2128,7 +2128,7 @@
] ]
} }
}, },
"/api/v1/meta/bases/{baseId}/visibility-rules": { "/api/v1/db/meta/projects/{baseId}/visibility-rules": {
"get": { "get": {
"summary": "Get UI ACL", "summary": "Get UI ACL",
"operationId": "base-model-visibility-list", "operationId": "base-model-visibility-list",
@ -2282,7 +2282,7 @@
] ]
} }
}, },
"/api/v1/meta/bases/": { "/api/v1/db/meta/projects/": {
"parameters": [ "parameters": [
{ {
"$ref": "#/components/parameters/xc-auth" "$ref": "#/components/parameters/xc-auth"
@ -2446,7 +2446,7 @@
] ]
} }
}, },
"/api/v1/meta/duplicate/{baseId}/{sourceId}": { "/api/v1/db/meta/duplicate/{baseId}/{sourceId}": {
"post": { "post": {
"summary": "Duplicate Base Source", "summary": "Duplicate Base Source",
"operationId": "base-source-duplicate", "operationId": "base-source-duplicate",
@ -2550,7 +2550,7 @@
] ]
} }
}, },
"/api/v1/meta/duplicate/{baseId}": { "/api/v1/db/meta/duplicate/{baseId}": {
"post": { "post": {
"summary": "Duplicate Base", "summary": "Duplicate Base",
"operationId": "base-duplicate", "operationId": "base-duplicate",
@ -2640,7 +2640,7 @@
] ]
} }
}, },
"/api/v1/meta/bases/{baseId}": { "/api/v1/db/meta/projects/{baseId}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -2800,7 +2800,7 @@
] ]
} }
}, },
"/api/v1/meta/bases/{baseId}/user": { "/api/v1/db/meta/projects/{baseId}/user": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -2833,7 +2833,7 @@
} }
} }
}, },
"/api/v1/meta/bases/{baseId}/sources/{sourceId}": { "/api/v1/db/meta/projects/{baseId}/bases/{sourceId}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -3012,7 +3012,7 @@
] ]
} }
}, },
"/api/v1/meta/bases/:baseId/sources/:sourceId/sqlView": { "/api/v1/db/meta/projects/:baseId/bases/:sourceId/sqlView": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -3069,7 +3069,7 @@
} }
} }
}, },
"/api/v1/meta/bases/{baseId}/sources/": { "/api/v1/db/meta/projects/{baseId}/bases/": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -3208,7 +3208,7 @@
] ]
} }
}, },
"/api/v1/meta/bases/{baseId}/sources/{sourceId}/share/erd": { "/api/v1/db/meta/projects/{baseId}/bases/{sourceId}/share/erd": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -3259,7 +3259,7 @@
] ]
} }
}, },
"/api/v1/meta/bases/{baseId}/shared": { "/api/v1/db/meta/projects/{baseId}/shared": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -3472,7 +3472,7 @@
] ]
} }
}, },
"/api/v1/meta/bases/{baseId}/cost": { "/api/v1/db/meta/projects/{baseId}/cost": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -3517,7 +3517,7 @@
"x-internal": true "x-internal": true
} }
}, },
"/api/v1/meta/bases/{baseId}/tables": { "/api/v1/db/meta/projects/{baseId}/tables": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -3976,7 +3976,7 @@
"description": "List all tables in a given base" "description": "List all tables in a given base"
} }
}, },
"/api/v1/meta/tables/{tableId}": { "/api/v1/db/meta/tables/{tableId}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -4493,7 +4493,7 @@
] ]
} }
}, },
"/api/v1/meta/duplicate/{baseId}/table/{tableId}": { "/api/v1/db/meta/duplicate/{baseId}/table/{tableId}": {
"post": { "post": {
"summary": "Duplicate Table", "summary": "Duplicate Table",
"operationId": "db-table-duplicate", "operationId": "db-table-duplicate",
@ -4589,7 +4589,7 @@
] ]
} }
}, },
"/api/v1/meta/bases/{baseId}/{sourceId}/tables": { "/api/v1/db/meta/projects/{baseId}/{sourceId}/tables": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -5160,7 +5160,7 @@
] ]
} }
}, },
"/api/v1/meta/tables/{tableId}/reorder": { "/api/v1/db/meta/tables/{tableId}/reorder": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -5229,7 +5229,7 @@
] ]
} }
}, },
"/api/v1/meta/tables/{tableId}/columns": { "/api/v1/db/meta/tables/{tableId}/columns": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -5312,7 +5312,7 @@
] ]
} }
}, },
"/api/v1/meta/columns/{columnId}": { "/api/v1/db/meta/columns/{columnId}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -5403,7 +5403,7 @@
] ]
} }
}, },
"/api/v1/meta/columns/{columnId}/primary": { "/api/v1/db/meta/columns/{columnId}/primary": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -5448,7 +5448,7 @@
] ]
} }
}, },
"/api/v1/meta/tables/{tableId}/views": { "/api/v1/db/meta/tables/{tableId}/views": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -5570,7 +5570,7 @@
] ]
} }
}, },
"/api/v1/meta/views/{viewId}": { "/api/v1/db/meta/views/{viewId}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -5689,7 +5689,7 @@
] ]
} }
}, },
"/api/v1/meta/views/{viewId}/show-all": { "/api/v1/db/meta/views/{viewId}/show-all": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -5743,7 +5743,7 @@
] ]
} }
}, },
"/api/v1/meta/views/{viewId}/hide-all": { "/api/v1/db/meta/views/{viewId}/hide-all": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -5797,7 +5797,7 @@
"description": "Hide All Columns in a given View" "description": "Hide All Columns in a given View"
} }
}, },
"/api/v1/meta/tables/{tableId}/share": { "/api/v1/db/meta/tables/{tableId}/share": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -5882,7 +5882,7 @@
] ]
} }
}, },
"/api/v1/meta/views/{viewId}/share": { "/api/v1/db/meta/views/{viewId}/share": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -6003,7 +6003,7 @@
] ]
} }
}, },
"/api/v1/meta/views/{viewId}/columns": { "/api/v1/db/meta/views/{viewId}/columns": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -6182,7 +6182,7 @@
] ]
} }
}, },
"/api/v1/meta/views/{viewId}/columns/{columnId}": { "/api/v1/db/meta/views/{viewId}/columns/{columnId}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -6256,7 +6256,7 @@
] ]
} }
}, },
"/api/v1/meta/views/{viewId}/sorts": { "/api/v1/db/meta/views/{viewId}/sorts": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -6378,7 +6378,7 @@
] ]
} }
}, },
"/api/v1/meta/sorts/{sortId}": { "/api/v1/db/meta/sorts/{sortId}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -6517,7 +6517,7 @@
] ]
} }
}, },
"/api/v1/meta/views/{viewId}/filters": { "/api/v1/db/meta/views/{viewId}/filters": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -6661,7 +6661,7 @@
] ]
} }
}, },
"/api/v1/meta/hooks/{hookId}/filters": { "/api/v1/db/meta/hooks/{hookId}/filters": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -6805,7 +6805,7 @@
] ]
} }
}, },
"/api/v1/meta/hooks/{hookId}/logs": { "/api/v1/db/meta/hooks/{hookId}/logs": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -6893,7 +6893,7 @@
] ]
} }
}, },
"/api/v1/meta/filters/{filterId}": { "/api/v1/db/meta/filters/{filterId}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -7043,7 +7043,7 @@
] ]
} }
}, },
"/api/v1/meta/filters/{filterGroupId}/children": { "/api/v1/db/meta/filters/{filterGroupId}/children": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -7117,7 +7117,7 @@
] ]
} }
}, },
"/api/v1/meta/tables/{tableId}/grids": { "/api/v1/db/meta/tables/{tableId}/grids": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -7202,7 +7202,7 @@
] ]
} }
}, },
"/api/v1/meta/tables/{tableId}/forms": { "/api/v1/db/meta/tables/{tableId}/forms": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -7287,7 +7287,7 @@
] ]
} }
}, },
"/api/v1/meta/forms/{formViewId}": { "/api/v1/db/meta/forms/{formViewId}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -7430,7 +7430,7 @@
] ]
} }
}, },
"/api/v1/meta/form-columns/{formViewColumnId}": { "/api/v1/db/meta/form-columns/{formViewColumnId}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -7495,7 +7495,7 @@
] ]
} }
}, },
"/api/v1/meta/grids/{viewId}": { "/api/v1/db/meta/grids/{viewId}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -7559,7 +7559,7 @@
] ]
} }
}, },
"/api/v1/meta/grids/{gridId}/grid-columns": { "/api/v1/db/meta/grids/{gridId}/grid-columns": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -7621,7 +7621,7 @@
] ]
} }
}, },
"/api/v1/meta/grid-columns/{columnId}": { "/api/v1/db/meta/grid-columns/{columnId}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -7687,7 +7687,7 @@
] ]
} }
}, },
"/api/v1/meta/tables/{tableId}/galleries": { "/api/v1/db/meta/tables/{tableId}/galleries": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -7770,7 +7770,7 @@
] ]
} }
}, },
"/api/v1/meta/galleries/{galleryViewId}": { "/api/v1/db/meta/galleries/{galleryViewId}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -7862,7 +7862,7 @@
] ]
} }
}, },
"/api/v1/meta/tables/{tableId}/kanbans": { "/api/v1/db/meta/tables/{tableId}/kanbans": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -7947,7 +7947,7 @@
] ]
} }
}, },
"/api/v1/meta/kanbans/{kanbanViewId}": { "/api/v1/db/meta/kanbans/{kanbanViewId}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -8082,7 +8082,7 @@
] ]
} }
}, },
"/api/v1/meta/tables/{tableId}/maps": { "/api/v1/db/meta/tables/{tableId}/maps": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -8168,7 +8168,7 @@
] ]
} }
}, },
"/api/v1/meta/maps/{mapViewId}": { "/api/v1/db/meta/maps/{mapViewId}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -8260,7 +8260,7 @@
] ]
} }
}, },
"/api/v1/meta/bases/{baseId}/meta-diff": { "/api/v1/db/meta/projects/{baseId}/meta-diff": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -8432,7 +8432,7 @@
"description": "Get the meta data difference between NC_DB and external data sources " "description": "Get the meta data difference between NC_DB and external data sources "
} }
}, },
"/api/v1/meta/bases/{baseId}/meta-diff/{sourceId}": { "/api/v1/db/meta/projects/{baseId}/meta-diff/{sourceId}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -8611,7 +8611,7 @@
"description": "Get the meta data difference between NC_DB and external data sources in a given Source" "description": "Get the meta data difference between NC_DB and external data sources in a given Source"
} }
}, },
"/api/v1/meta/bases/{baseId}/has-empty-or-null-filters": { "/api/v1/db/meta/projects/{baseId}/has-empty-or-null-filters": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -8653,7 +8653,7 @@
"x-internal": true "x-internal": true
} }
}, },
"/api/v1/data/{orgs}/{baseName}/{tableName}": { "/api/v1/db/data/{orgs}/{baseName}/{tableName}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -8907,7 +8907,7 @@
] ]
} }
}, },
"/api/v1/data/{orgs}/{baseName}/{tableName}/find-one": { "/api/v1/db/data/{orgs}/{baseName}/{tableName}/find-one": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -8997,7 +8997,7 @@
} }
} }
}, },
"/api/v1/data/{orgs}/{baseName}/{tableName}/groupby": { "/api/v1/db/data/{orgs}/{baseName}/{tableName}/groupby": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -9089,7 +9089,7 @@
} }
} }
}, },
"/api/v1/data/{orgs}/{baseName}/{tableName}/views/{viewName}/group/{columnId}": { "/api/v1/db/data/{orgs}/{baseName}/{tableName}/views/{viewName}/group/{columnId}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -9267,7 +9267,7 @@
} }
} }
}, },
"/api/v1/data/{orgs}/{baseName}/{tableName}/group/{columnId}": { "/api/v1/db/data/{orgs}/{baseName}/{tableName}/group/{columnId}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -9435,7 +9435,7 @@
} }
} }
}, },
"/api/v1/data/{orgs}/{baseName}/{tableName}/views/{viewName}": { "/api/v1/db/data/{orgs}/{baseName}/{tableName}/views/{viewName}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -9669,7 +9669,7 @@
"description": "Create a new row in the given Table View" "description": "Create a new row in the given Table View"
} }
}, },
"/api/v1/data/{orgs}/{baseName}/{tableName}/views/{viewName}/find-one": { "/api/v1/db/data/{orgs}/{baseName}/{tableName}/views/{viewName}/find-one": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -9773,7 +9773,7 @@
} }
} }
}, },
"/api/v1/data/{orgs}/{baseName}/{tableName}/views/{viewName}/groupby": { "/api/v1/db/data/{orgs}/{baseName}/{tableName}/views/{viewName}/groupby": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -9876,7 +9876,7 @@
} }
} }
}, },
"/api/v1/data/{orgs}/{baseName}/{tableName}/views/{viewName}/count": { "/api/v1/db/data/{orgs}/{baseName}/{tableName}/views/{viewName}/count": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -9970,7 +9970,7 @@
} }
} }
}, },
"/api/v1/data/{orgs}/{baseName}/{tableName}/views/{viewName}/{rowId}": { "/api/v1/db/data/{orgs}/{baseName}/{tableName}/views/{viewName}/{rowId}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -10146,7 +10146,7 @@
] ]
} }
}, },
"/api/v1/data/{orgs}/{baseName}/{tableName}/views/{viewName}/{rowId}/exist": { "/api/v1/db/data/{orgs}/{baseName}/{tableName}/views/{viewName}/{rowId}/exist": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -10227,7 +10227,7 @@
] ]
} }
}, },
"/api/v1/data/{orgs}/{baseName}/{tableName}/{rowId}": { "/api/v1/db/data/{orgs}/{baseName}/{tableName}/{rowId}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -10402,7 +10402,7 @@
] ]
} }
}, },
"/api/v1/data/{orgs}/{baseName}/{tableName}/{rowId}/exist": { "/api/v1/db/data/{orgs}/{baseName}/{tableName}/{rowId}/exist": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -10475,7 +10475,7 @@
] ]
} }
}, },
"/api/v1/data/bulk/{orgs}/{baseName}/{tableName}": { "/api/v1/db/data/bulk/{orgs}/{baseName}/{tableName}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -10733,7 +10733,7 @@
] ]
} }
}, },
"/api/v1/data/bulk/{orgs}/{baseName}/{tableName}/all": { "/api/v1/db/data/bulk/{orgs}/{baseName}/{tableName}/all": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -10890,7 +10890,7 @@
] ]
} }
}, },
"/api/v1/data/{orgs}/{baseName}/{tableName}/views/{viewName}/export/{type}": { "/api/v1/db/data/{orgs}/{baseName}/{tableName}/views/{viewName}/export/{type}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -10976,7 +10976,7 @@
] ]
} }
}, },
"/api/v1/data/{orgs}/{baseName}/{tableName}/export/{type}": { "/api/v1/db/data/{orgs}/{baseName}/{tableName}/export/{type}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -11054,7 +11054,7 @@
] ]
} }
}, },
"/api/v1/data/{orgs}/{baseName}/{tableName}/{rowId}/{relationType}/{columnName}": { "/api/v1/db/data/{orgs}/{baseName}/{tableName}/{rowId}/{relationType}/{columnName}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -11166,7 +11166,7 @@
"description": "List all nested relations rows" "description": "List all nested relations rows"
} }
}, },
"/api/v1/data/{orgs}/{baseName}/{tableName}/{rowId}/{relationType}/{columnName}/{refRowId}": { "/api/v1/db/data/{orgs}/{baseName}/{tableName}/{rowId}/{relationType}/{columnName}/{refRowId}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -11391,7 +11391,7 @@
] ]
} }
}, },
"/api/v1/data/{orgs}/{baseName}/{tableName}/{rowId}/{relationType}/{columnName}/exclude": { "/api/v1/db/data/{orgs}/{baseName}/{tableName}/{rowId}/{relationType}/{columnName}/exclude": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -11501,7 +11501,7 @@
"description": "Get the table rows but exculding the current record's children and parent" "description": "Get the table rows but exculding the current record's children and parent"
} }
}, },
"/api/v1/public/shared-view/{sharedViewUuid}/group/{columnId}": { "/api/v1/db/public/shared-view/{sharedViewUuid}/group/{columnId}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -11742,7 +11742,7 @@
"description": "List Shared View Grouped Data" "description": "List Shared View Grouped Data"
} }
}, },
"/api/v1/public/shared-view/{sharedViewUuid}/rows": { "/api/v1/db/public/shared-view/{sharedViewUuid}/rows": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -11950,7 +11950,7 @@
"description": "Create a new row for the target shared view" "description": "Create a new row for the target shared view"
} }
}, },
"/api/v1/public/shared-view/{sharedViewUuid}/groupby": { "/api/v1/db/public/shared-view/{sharedViewUuid}/groupby": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -12073,7 +12073,7 @@
"description": "List all shared view rows grouped by a column" "description": "List all shared view rows grouped by a column"
} }
}, },
"/api/v1/public/shared-view/{sharedViewUuid}/rows/{rowId}/{relationType}/{columnName}": { "/api/v1/db/public/shared-view/{sharedViewUuid}/rows/{rowId}/{relationType}/{columnName}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -12271,7 +12271,7 @@
"description": "List all nested list data in a given shared view" "description": "List all nested list data in a given shared view"
} }
}, },
"/api/v1/public/shared-view/{sharedViewUuid}/rows/export/{type}": { "/api/v1/db/public/shared-view/{sharedViewUuid}/rows/export/{type}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -12329,7 +12329,7 @@
] ]
} }
}, },
"/api/v1/public/shared-view/{sharedViewUuid}/nested/{columnName}": { "/api/v1/db/public/shared-view/{sharedViewUuid}/nested/{columnName}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -12451,7 +12451,7 @@
"description": "List Nested Data Relation" "description": "List Nested Data Relation"
} }
}, },
"/api/v1/public/shared-base/{sharedBaseUuid}/meta": { "/api/v1/db/public/shared-base/{sharedBaseUuid}/meta": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -12506,7 +12506,7 @@
] ]
} }
}, },
"/api/v1/public/shared-view/{sharedViewUuid}/meta": { "/api/v1/db/public/shared-view/{sharedViewUuid}/meta": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -12611,7 +12611,7 @@
"description": "Get Share View Meta" "description": "Get Share View Meta"
} }
}, },
"/api/v1/public/shared-erd/{sharedErdUuid}/meta": { "/api/v1/db/public/shared-erd/{sharedErdUuid}/meta": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -12632,7 +12632,7 @@
"parameters": [] "parameters": []
} }
}, },
"/api/v1/meta/audits/comments": { "/api/v1/db/meta/audits/comments": {
"parameters": [ "parameters": [
{ {
"$ref": "#/components/parameters/xc-auth" "$ref": "#/components/parameters/xc-auth"
@ -12814,7 +12814,7 @@
] ]
} }
}, },
"/api/v1/meta/audits/{auditId}/comment": { "/api/v1/db/meta/audits/{auditId}/comment": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -12879,7 +12879,7 @@
} }
} }
}, },
"/api/v1/meta/audits/comments/count": { "/api/v1/db/meta/audits/comments/count": {
"parameters": [ "parameters": [
{ {
"$ref": "#/components/parameters/xc-auth" "$ref": "#/components/parameters/xc-auth"
@ -12967,7 +12967,7 @@
] ]
} }
}, },
"/api/v1/meta/bases/{baseId}/audits": { "/api/v1/db/meta/projects/{baseId}/audits": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -13050,7 +13050,7 @@
] ]
} }
}, },
"/api/v1/meta/audits/rows/{rowId}/update": { "/api/v1/db/meta/audits/rows/{rowId}/update": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -13124,7 +13124,7 @@
] ]
} }
}, },
"/api/v1/meta/tables/{tableId}/hooks": { "/api/v1/db/meta/tables/{tableId}/hooks": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -13271,7 +13271,7 @@
] ]
} }
}, },
"/api/v1/meta/tables/{tableId}/hooks/test": { "/api/v1/db/meta/tables/{tableId}/hooks/test": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -13378,7 +13378,7 @@
] ]
} }
}, },
"/api/v1/meta/tables/{tableId}/hooks/samplePayload/{operation}/{version}": { "/api/v1/db/meta/tables/{tableId}/hooks/samplePayload/{operation}/{version}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -13472,7 +13472,7 @@
] ]
} }
}, },
"/api/v1/meta/hooks/{hookId}": { "/api/v1/db/meta/hooks/{hookId}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -13596,7 +13596,7 @@
] ]
} }
}, },
"/api/v1/meta/plugins": { "/api/v1/db/meta/plugins": {
"parameters": [ "parameters": [
{ {
"$ref": "#/components/parameters/xc-auth" "$ref": "#/components/parameters/xc-auth"
@ -13644,7 +13644,7 @@
] ]
} }
}, },
"/api/v1/meta/plugins/webhook": { "/api/v1/db/meta/plugins/webhook": {
"parameters": [ "parameters": [
{ {
"$ref": "#/components/parameters/xc-auth" "$ref": "#/components/parameters/xc-auth"
@ -13692,7 +13692,7 @@
] ]
} }
}, },
"/api/v1/meta/plugins/{pluginTitle}/status": { "/api/v1/db/meta/plugins/{pluginTitle}/status": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -13734,7 +13734,7 @@
"x-internal": false "x-internal": false
} }
}, },
"/api/v1/meta/plugins/test": { "/api/v1/db/meta/plugins/test": {
"parameters": [ "parameters": [
{ {
"$ref": "#/components/parameters/xc-auth" "$ref": "#/components/parameters/xc-auth"
@ -13785,7 +13785,7 @@
} }
} }
}, },
"/api/v1/meta/plugins/{pluginId}": { "/api/v1/db/meta/plugins/{pluginId}": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -13858,7 +13858,7 @@
"x-internal": false "x-internal": false
} }
}, },
"/api/v1/meta/connection/test": { "/api/v1/db/meta/connection/test": {
"parameters": [ "parameters": [
{ {
"$ref": "#/components/parameters/xc-auth" "$ref": "#/components/parameters/xc-auth"
@ -13987,7 +13987,7 @@
] ]
} }
}, },
"/api/v1/meta/connection/select": { "/api/v1/db/meta/connection/select": {
"parameters": [], "parameters": [],
"post": { "post": {
"summary": "", "summary": "",
@ -14142,7 +14142,7 @@
] ]
} }
}, },
"/api/v1/meta/nocodb/info": { "/api/v1/db/meta/nocodb/info": {
"parameters": [ "parameters": [
{ {
"$ref": "#/components/parameters/xc-auth" "$ref": "#/components/parameters/xc-auth"
@ -14294,7 +14294,7 @@
] ]
} }
}, },
"/api/v1/meta/axiosRequestMake": { "/api/v1/db/meta/axiosRequestMake": {
"parameters": [ "parameters": [
{ {
"$ref": "#/components/parameters/xc-auth" "$ref": "#/components/parameters/xc-auth"
@ -14695,7 +14695,7 @@
] ]
} }
}, },
"/api/v1/meta/cache": { "/api/v1/db/meta/cache": {
"get": { "get": {
"summary": "Get Cache", "summary": "Get Cache",
"tags": [ "tags": [
@ -14749,7 +14749,7 @@
} }
] ]
}, },
"/api/v1/meta/bases/{baseId}/api-tokens": { "/api/v1/db/meta/projects/{baseId}/api-tokens": {
"get": { "get": {
"summary": "List API Tokens in Base", "summary": "List API Tokens in Base",
"tags": [ "tags": [
@ -14868,7 +14868,7 @@
} }
] ]
}, },
"/api/v1/meta/bases/{baseId}/api-tokens/{token}": { "/api/v1/db/meta/projects/{baseId}/api-tokens/{token}": {
"delete": { "delete": {
"summary": "Delete API Token", "summary": "Delete API Token",
"operationId": "api-token-delete", "operationId": "api-token-delete",
@ -14927,7 +14927,7 @@
} }
] ]
}, },
"/api/v1/storage/upload": { "/api/v1/db/storage/upload": {
"post": { "post": {
"summary": "Attachment Upload", "summary": "Attachment Upload",
"operationId": "storage-upload", "operationId": "storage-upload",
@ -14973,7 +14973,7 @@
"description": "Upload attachment" "description": "Upload attachment"
} }
}, },
"/api/v1/storage/upload-by-url": { "/api/v1/db/storage/upload-by-url": {
"post": { "post": {
"summary": "Attachment Upload by URL", "summary": "Attachment Upload by URL",
"operationId": "storage-upload-by-url", "operationId": "storage-upload-by-url",
@ -15012,7 +15012,7 @@
"description": "Upload attachment by URL. Used in Airtable Migration." "description": "Upload attachment by URL. Used in Airtable Migration."
} }
}, },
"/api/v1/meta/bases/{baseId}/users/{userId}/resend-invite": { "/api/v1/db/meta/projects/{baseId}/users/{userId}/resend-invite": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -15192,7 +15192,7 @@
"description": "Mark all notifications as read" "description": "Mark all notifications as read"
} }
}, },
"/api/v1/meta/tables/{tableId}/columns/hash": { "/api/v1/db/meta/tables/{tableId}/columns/hash": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
@ -15238,7 +15238,7 @@
] ]
} }
}, },
"/api/v1/meta/tables/{tableId}/columns/bulk": { "/api/v1/db/meta/tables/{tableId}/columns/bulk": {
"parameters": [ "parameters": [
{ {
"schema": { "schema": {

31
packages/nocodb/src/services/api-docs/swagger/templates/paths.ts

@ -25,7 +25,7 @@ export const getModelPaths = async (ctx: {
columns: SwaggerColumn[]; columns: SwaggerColumn[];
baseName: string; baseName: string;
}): Promise<{ [path: string]: any }> => ({ }): Promise<{ [path: string]: any }> => ({
[`/api/v1/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}`]: { [`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}`]: {
get: { get: {
summary: `${ctx.tableName} list`, summary: `${ctx.tableName} list`,
operationId: `${ctx.tableName.toLowerCase()}-db-table-row-list`, operationId: `${ctx.tableName.toLowerCase()}-db-table-row-list`,
@ -84,7 +84,7 @@ export const getModelPaths = async (ctx: {
} }
: {}), : {}),
}, },
[`/api/v1/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/{rowId}`]: { [`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/{rowId}`]: {
parameters: [rowIdParam], parameters: [rowIdParam],
...(ctx.type === ModelTypes.TABLE ...(ctx.type === ModelTypes.TABLE
? { ? {
@ -149,7 +149,7 @@ export const getModelPaths = async (ctx: {
} }
: {}), : {}),
}, },
[`/api/v1/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/count`]: { [`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/count`]: {
get: { get: {
summary: `${ctx.tableName} count`, summary: `${ctx.tableName} count`,
operationId: `${ctx.tableName.toLowerCase()}-count`, operationId: `${ctx.tableName.toLowerCase()}-count`,
@ -168,7 +168,7 @@ export const getModelPaths = async (ctx: {
}, },
}, },
}, },
[`/api/v1/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/find-one`]: { [`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/find-one`]: {
get: { get: {
summary: `${ctx.tableName} find-one`, summary: `${ctx.tableName} find-one`,
operationId: `${ctx.tableName.toLowerCase()}-db-table-row-find-one`, operationId: `${ctx.tableName.toLowerCase()}-db-table-row-find-one`,
@ -189,7 +189,7 @@ export const getModelPaths = async (ctx: {
}, },
}, },
}, },
[`/api/v1/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/groupby`]: { [`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/groupby`]: {
get: { get: {
summary: `${ctx.tableName} groupby`, summary: `${ctx.tableName} groupby`,
operationId: `${ctx.tableName.toLowerCase()}-groupby`, operationId: `${ctx.tableName.toLowerCase()}-groupby`,
@ -230,7 +230,7 @@ export const getModelPaths = async (ctx: {
}, },
...(ctx.type === ModelTypes.TABLE ...(ctx.type === ModelTypes.TABLE
? { ? {
[`/api/v1/data/bulk/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}`]: { [`/api/v1/db/data/bulk/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}`]: {
post: { post: {
summary: `${ctx.tableName} bulk insert`, summary: `${ctx.tableName} bulk insert`,
description: description:
@ -304,7 +304,7 @@ export const getModelPaths = async (ctx: {
}, },
}, },
}, },
[`/api/v1/data/bulk/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/all`]: [`/api/v1/db/data/bulk/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/all`]:
{ {
parameters: [whereParam], parameters: [whereParam],
patch: { patch: {
@ -352,7 +352,7 @@ export const getModelPaths = async (ctx: {
...(isRelationExist(ctx.columns) ...(isRelationExist(ctx.columns)
? { ? {
[`/api/v1/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/{rowId}/{relationType}/{columnName}`]: [`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/{rowId}/{relationType}/{columnName}`]:
{ {
parameters: [ parameters: [
rowIdParam, rowIdParam,
@ -376,7 +376,7 @@ export const getModelPaths = async (ctx: {
parameters: [limitParam, offsetParam], parameters: [limitParam, offsetParam],
}, },
}, },
[`/api/v1/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/{rowId}/{relationType}/{columnName}/{refRowId}`]: [`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/{rowId}/{relationType}/{columnName}/{refRowId}`]:
{ {
parameters: [ parameters: [
rowIdParam, rowIdParam,
@ -417,7 +417,7 @@ export const getModelPaths = async (ctx: {
tags: [ctx.tableName], tags: [ctx.tableName],
}, },
}, },
[`/api/v1/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/{rowId}/{relationType}/{columnName}/exclude`]: [`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/{rowId}/{relationType}/{columnName}/exclude`]:
{ {
parameters: [ parameters: [
rowIdParam, rowIdParam,
@ -446,7 +446,8 @@ export const getModelPaths = async (ctx: {
: {}), : {}),
} }
: {}), : {}),
[`/api/v1/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/export/{type}`]: { [`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/export/{type}`]:
{
parameters: [exportTypeParam], parameters: [exportTypeParam],
get: { get: {
summary: 'Rows export', summary: 'Rows export',
@ -478,7 +479,7 @@ export const getViewPaths = async (ctx: {
baseName: string; baseName: string;
columns: SwaggerColumn[]; columns: SwaggerColumn[];
}): Promise<any> => ({ }): Promise<any> => ({
[`/api/v1/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/views/${ctx.viewName}`]: [`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/views/${ctx.viewName}`]:
{ {
get: { get: {
summary: `${ctx.viewName} list`, summary: `${ctx.viewName} list`,
@ -535,7 +536,7 @@ export const getViewPaths = async (ctx: {
} }
: {}), : {}),
}, },
[`/api/v1/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/views/${ctx.viewName}/count`]: [`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/views/${ctx.viewName}/count`]:
{ {
get: { get: {
summary: `${ctx.viewName} count`, summary: `${ctx.viewName} count`,
@ -562,7 +563,7 @@ export const getViewPaths = async (ctx: {
}, },
...(ctx.type === ModelTypes.TABLE ...(ctx.type === ModelTypes.TABLE
? { ? {
[`/api/v1/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/views/${ctx.viewName}/{rowId}`]: [`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/views/${ctx.viewName}/{rowId}`]:
{ {
parameters: [rowIdParam], parameters: [rowIdParam],
get: { get: {
@ -625,7 +626,7 @@ export const getViewPaths = async (ctx: {
}, },
} }
: {}), : {}),
[`/api/v1/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/views/${ctx.viewName}/export/{type}`]: [`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/views/${ctx.viewName}/export/{type}`]:
{ {
parameters: [exportTypeParam], parameters: [exportTypeParam],
get: { get: {

6
packages/nocodb/tests/unit/factory/base.ts

@ -59,7 +59,7 @@ const defaultSharedBaseValue = {
const createSharedBase = async (app, token, base, sharedBaseArgs = {}) => { const createSharedBase = async (app, token, base, sharedBaseArgs = {}) => {
await request(app) await request(app)
.post(`/api/v1/meta/bases/${base.id}/shared`) .post(`/api/v1/db/meta/projects/${base.id}/shared`)
.set('xc-auth', token) .set('xc-auth', token)
.send({ .send({
...defaultSharedBaseValue, ...defaultSharedBaseValue,
@ -69,7 +69,7 @@ const createSharedBase = async (app, token, base, sharedBaseArgs = {}) => {
const createSakilaProject = async (context) => { const createSakilaProject = async (context) => {
const response = await request(context.app) const response = await request(context.app)
.post('/api/v1/meta/bases/') .post('/api/v1/db/meta/projects/')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send(sakilaProjectConfig(context)); .send(sakilaProjectConfig(context));
@ -81,7 +81,7 @@ const createProject = async (
baseArgs: ProjectArgs = defaultProjectValue, baseArgs: ProjectArgs = defaultProjectValue,
) => { ) => {
const response = await request(context.app) const response = await request(context.app)
.post('/api/v1/meta/bases/') .post('/api/v1/db/meta/projects/')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
...baseArgs, ...baseArgs,

4
packages/nocodb/tests/unit/factory/column.ts

@ -164,7 +164,7 @@ const customColumns = function (type: string, options: any = {}) {
const createColumn = async (context, table, columnAttr) => { const createColumn = async (context, table, columnAttr) => {
await request(context.app) await request(context.app)
.post(`/api/v1/meta/tables/${table.id}/columns`) .post(`/api/v1/db/meta/tables/${table.id}/columns`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
...columnAttr, ...columnAttr,
@ -373,7 +373,7 @@ const updateViewColumn = async (
{ view, column, attr }: { column: Column; view: View; attr: any }, { view, column, attr }: { column: Column; view: View; attr: any },
) => { ) => {
const res = await request(context.app) const res = await request(context.app)
.patch(`/api/v1/meta/views/${view.id}/columns/${column.id}`) .patch(`/api/v1/db/meta/views/${view.id}/columns/${column.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
...attr, ...attr,

10
packages/nocodb/tests/unit/factory/row.ts

@ -200,7 +200,7 @@ const rowMixedValue = (column: ColumnType, index: number) => {
const getRow = async (context, { base, table, id }) => { const getRow = async (context, { base, table, id }) => {
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${base.id}/${table.id}/${id}`) .get(`/api/v1/db/data/noco/${base.id}/${table.id}/${id}`)
.set('xc-auth', context.token); .set('xc-auth', context.token);
if (response.status !== 200) { if (response.status !== 200) {
@ -240,7 +240,7 @@ const getOneRow = async (
{ base, table }: { base: Base; table: Model }, { base, table }: { base: Base; table: Model },
) => { ) => {
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${base.id}/${table.id}/find-one`) .get(`/api/v1/db/data/noco/${base.id}/${table.id}/find-one`)
.set('xc-auth', context.token); .set('xc-auth', context.token);
return response.body; return response.body;
@ -281,7 +281,7 @@ const createRow = async (
const rowData = generateDefaultRowAttributes({ columns, index }); const rowData = generateDefaultRowAttributes({ columns, index });
const response = await request(context.app) const response = await request(context.app)
.post(`/api/v1/data/noco/${base.id}/${table.id}`) .post(`/api/v1/db/data/noco/${base.id}/${table.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send(rowData); .send(rowData);
@ -301,7 +301,7 @@ const createBulkRows = async (
}, },
) => { ) => {
await request(context.app) await request(context.app)
.post(`/api/v1/data/bulk/noco/${base.id}/${table.id}`) .post(`/api/v1/db/data/bulk/noco/${base.id}/${table.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send(values) .send(values)
.expect(200); .expect(200);
@ -340,7 +340,7 @@ const createChildRow = async (
await request(context.app) await request(context.app)
.post( .post(
`/api/v1/data/noco/${base.id}/${table.id}/${rowId}/${type}/${column.title}/${childRowId}`, `/api/v1/db/data/noco/${base.id}/${table.id}/${rowId}/${type}/${column.title}/${childRowId}`,
) )
.set('xc-auth', context.token); .set('xc-auth', context.token);

2
packages/nocodb/tests/unit/factory/table.ts

@ -12,7 +12,7 @@ const defaultTableValue = (context) => ({
const createTable = async (context, base, args = {}) => { const createTable = async (context, base, args = {}) => {
const defaultValue = defaultTableValue(context); const defaultValue = defaultTableValue(context);
const response = await request(context.app) const response = await request(context.app)
.post(`/api/v1/meta/bases/${base.id}/tables`) .post(`/api/v1/db/meta/projects/${base.id}/tables`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ ...defaultValue, ...args }); .send({ ...defaultValue, ...args });

10
packages/nocodb/tests/unit/factory/view.ts

@ -31,7 +31,7 @@ const createView = async (
}; };
const response = await request(context.app) const response = await request(context.app)
.post(`/api/v1/meta/tables/${table.id}/${viewTypeStr(type)}`) .post(`/api/v1/db/meta/tables/${table.id}/${viewTypeStr(type)}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
title, title,
@ -53,7 +53,7 @@ const getView = async (
{ table, name }: { table: Model; name: string }, { table, name }: { table: Model; name: string },
) => { ) => {
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/meta/tables/${table.id}/views`) .get(`/api/v1/db/meta/tables/${table.id}/views`)
.set('xc-auth', context.token); .set('xc-auth', context.token);
if (response.status !== 200) { if (response.status !== 200) {
throw new Error('List Views', response.body.message); throw new Error('List Views', response.body.message);
@ -85,7 +85,7 @@ const updateView = async (
if (filter.length) { if (filter.length) {
for (let i = 0; i < filter.length; i++) { for (let i = 0; i < filter.length; i++) {
await request(context.app) await request(context.app)
.post(`/api/v1/meta/views/${view.id}/filters`) .post(`/api/v1/db/meta/views/${view.id}/filters`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send(filter[i]) .send(filter[i])
.expect(200); .expect(200);
@ -95,7 +95,7 @@ const updateView = async (
if (sort.length) { if (sort.length) {
for (let i = 0; i < sort.length; i++) { for (let i = 0; i < sort.length; i++) {
await request(context.app) await request(context.app)
.post(`/api/v1/meta/views/${view.id}/sorts`) .post(`/api/v1/db/meta/views/${view.id}/sorts`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send(sort[i]) .send(sort[i])
.expect(200); .expect(200);
@ -113,7 +113,7 @@ const updateView = async (
).id; ).id;
// configure view to hide selected fields // configure view to hide selected fields
await request(context.app) await request(context.app)
.patch(`/api/v1/meta/views/${view.id}/columns/${viewColumnId}`) .patch(`/api/v1/db/meta/views/${view.id}/columns/${viewColumnId}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ show: false }) .send({ show: false })
.expect(200); .expect(200);

16
packages/nocodb/tests/unit/rest/tests/attachment.test.ts

@ -25,7 +25,7 @@ function attachmentTests() {
it('Upload file - Super admin', async () => { it('Upload file - Super admin', async () => {
const response = await request(context.app) const response = await request(context.app)
.post('/api/v1/storage/upload') .post('/api/v1/db/storage/upload')
.attach('files', FILE_PATH) .attach('files', FILE_PATH)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -37,7 +37,7 @@ function attachmentTests() {
it('Upload file - Without token', async () => { it('Upload file - Without token', async () => {
const response = await request(context.app) const response = await request(context.app)
.post('/api/v1/storage/upload') .post('/api/v1/db/storage/upload')
.attach('files', FILE_PATH) .attach('files', FILE_PATH)
.expect(401); .expect(401);
@ -58,7 +58,7 @@ function attachmentTests() {
.expect(200); .expect(200);
const response = await request(context.app) const response = await request(context.app)
.post('/api/v1/storage/upload') .post('/api/v1/db/storage/upload')
.attach('files', FILE_PATH) .attach('files', FILE_PATH)
.set('xc-auth', signupResponse.body.token) .set('xc-auth', signupResponse.body.token)
.expect(400); .expect(400);
@ -81,7 +81,7 @@ function attachmentTests() {
// update user role to creator // update user role to creator
const usersListResponse = await request(context.app) const usersListResponse = await request(context.app)
.get('/api/v1/users') .get('/api/v1/db/users')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -92,7 +92,7 @@ function attachmentTests() {
expect(user).to.have.property('roles').to.be.equal(OrgUserRoles.VIEWER); expect(user).to.have.property('roles').to.be.equal(OrgUserRoles.VIEWER);
await request(context.app) await request(context.app)
.patch('/api/v1/users/' + user.id) .patch('/api/v1/db/users/' + user.id)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ roles: OrgUserRoles.CREATOR }) .send({ roles: OrgUserRoles.CREATOR })
.expect(200); .expect(200);
@ -104,7 +104,7 @@ function attachmentTests() {
.expect(200); .expect(200);
const response = await request(context.app) const response = await request(context.app)
.post('/api/v1/storage/upload') .post('/api/v1/db/storage/upload')
.attach('files', FILE_PATH) .attach('files', FILE_PATH)
.set('xc-auth', signinResponse.body.token) .set('xc-auth', signinResponse.body.token)
.expect(200); .expect(200);
@ -134,7 +134,7 @@ function attachmentTests() {
// invite user to base with editor role // invite user to base with editor role
await request(context.app) await request(context.app)
.post(`/api/v1/meta/bases/${newProject.id}/users`) .post(`/api/v1/db/meta/projects/${newProject.id}/users`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
roles: ProjectRoles.EDITOR, roles: ProjectRoles.EDITOR,
@ -152,7 +152,7 @@ function attachmentTests() {
.expect(200); .expect(200);
const response = await request(context.app) const response = await request(context.app)
.post('/api/v1/storage/upload') .post('/api/v1/db/storage/upload')
.attach('files', FILE_PATH) .attach('files', FILE_PATH)
.set('xc-auth', signinResponse.body.token) .set('xc-auth', signinResponse.body.token)
.expect(200); .expect(200);

50
packages/nocodb/tests/unit/rest/tests/base.test.ts

@ -39,7 +39,7 @@ function baseTest() {
it('Get base info', async () => { it('Get base info', async () => {
await request(context.app) await request(context.app)
.get(`/api/v1/meta/bases/${base.id}/info`) .get(`/api/v1/db/meta/projects/${base.id}/info`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({}) .send({})
.expect(200); .expect(200);
@ -48,18 +48,18 @@ function baseTest() {
// todo: Test by creating models under base and check if the UCL is working // todo: Test by creating models under base and check if the UCL is working
it('UI ACL', async () => { it('UI ACL', async () => {
await request(context.app) await request(context.app)
.get(`/api/v1/meta/bases/${base.id}/visibility-rules`) .get(`/api/v1/db/meta/projects/${base.id}/visibility-rules`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({}) .send({})
.expect(200); .expect(200);
}); });
// todo: Test creating visibility set // todo: Test creating visibility set
it('List bases', async () => { it('List projects', async () => {
let response; let response;
if (process.env.EE !== 'true') { if (process.env.EE !== 'true') {
response = await request(context.app) response = await request(context.app)
.get('/api/v1/meta/bases/') .get('/api/v1/db/meta/projects/')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({}) .send({})
.expect(200); .expect(200);
@ -71,14 +71,13 @@ function baseTest() {
.expect(200); .expect(200);
} }
if (response.body.list.length !== 1) if (response.body.list.length !== 1) new Error('Should list only 1 base');
new Error('Should list only 1 base');
if (!response.body.pageInfo) new Error('Should have pagination info'); if (!response.body.pageInfo) new Error('Should have pagination info');
}); });
it('Create base', async () => { it('Create base', async () => {
const response = await request(context.app) const response = await request(context.app)
.post('/api/v1/meta/bases/') .post('/api/v1/db/meta/projects/')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
title: 'Title1', title: 'Title1',
@ -92,9 +91,9 @@ function baseTest() {
if (!newProject) return new Error('Base not created'); if (!newProject) return new Error('Base not created');
}); });
it('Create bases with existing title', async () => { it('Create projects with existing title', async () => {
await request(context.app) await request(context.app)
.post(`/api/v1/meta/bases/`) .post(`/api/v1/db/meta/projects/`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
title: base.title, title: base.title,
@ -111,7 +110,7 @@ function baseTest() {
// title: 'deletedTitle', // title: 'deletedTitle',
// }); // });
// await request(app) // await request(app)
// .delete('/api/v1/meta/bases/${toBeDeletedProject.id}') // .delete('/api/v1/db/meta/projects/${toBeDeletedProject.id}')
// .set('xc-auth', token) // .set('xc-auth', token)
// .send({ // .send({
// title: 'Title1', // title: 'Title1',
@ -131,18 +130,17 @@ function baseTest() {
it('Read base', async () => { it('Read base', async () => {
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/meta/bases/${base.id}`) .get(`/api/v1/db/meta/projects/${base.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send() .send()
.expect(200); .expect(200);
if (response.body.id !== base.id) if (response.body.id !== base.id) return new Error('Got the wrong base');
return new Error('Got the wrong base');
}); });
it('Update bases', async () => { it('Update projects', async () => {
await request(context.app) await request(context.app)
.patch(`/api/v1/meta/bases/${base.id}`) .patch(`/api/v1/db/meta/projects/${base.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
title: 'NewTitle', title: 'NewTitle',
@ -155,7 +153,7 @@ function baseTest() {
} }
}); });
it('Update bases with existing title', async function () { it('Update projects with existing title', async function () {
if (process.env.EE !== 'true') { if (process.env.EE !== 'true') {
const newProject = await createProject(context, { const newProject = await createProject(context, {
title: 'NewTitle1', title: 'NewTitle1',
@ -163,7 +161,7 @@ function baseTest() {
// Allow base rename to be replaced with same title // Allow base rename to be replaced with same title
await request(context.app) await request(context.app)
.patch(`/api/v1/meta/bases/${base.id}`) .patch(`/api/v1/db/meta/projects/${base.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
title: newProject.title, title: newProject.title,
@ -174,7 +172,7 @@ function baseTest() {
it('Create base shared base', async () => { it('Create base shared base', async () => {
await request(context.app) await request(context.app)
.post(`/api/v1/meta/bases/${base.id}/shared`) .post(`/api/v1/db/meta/projects/${base.id}/shared`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
roles: 'viewer', roles: 'viewer',
@ -195,7 +193,7 @@ function baseTest() {
it('Created base shared base should have only editor or viewer role', async () => { it('Created base shared base should have only editor or viewer role', async () => {
await request(context.app) await request(context.app)
.post(`/api/v1/meta/bases/${base.id}/shared`) .post(`/api/v1/db/meta/projects/${base.id}/shared`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
roles: 'commenter', roles: 'commenter',
@ -214,7 +212,7 @@ function baseTest() {
await createSharedBase(context.app, context.token, base); await createSharedBase(context.app, context.token, base);
await request(context.app) await request(context.app)
.patch(`/api/v1/meta/bases/${base.id}/shared`) .patch(`/api/v1/db/meta/projects/${base.id}/shared`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
roles: 'commenter', roles: 'commenter',
@ -233,7 +231,7 @@ function baseTest() {
await createSharedBase(context.app, context.token, base); await createSharedBase(context.app, context.token, base);
await request(context.app) await request(context.app)
.patch(`/api/v1/meta/bases/${base.id}/shared`) .patch(`/api/v1/db/meta/projects/${base.id}/shared`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
roles: 'editor', roles: 'editor',
@ -251,7 +249,7 @@ function baseTest() {
await createSharedBase(context.app, context.token, base); await createSharedBase(context.app, context.token, base);
await request(context.app) await request(context.app)
.get(`/api/v1/meta/bases/${base.id}/shared`) .get(`/api/v1/db/meta/projects/${base.id}/shared`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send() .send()
.expect(200); .expect(200);
@ -266,7 +264,7 @@ function baseTest() {
await createSharedBase(context.app, context.token, base); await createSharedBase(context.app, context.token, base);
await request(context.app) await request(context.app)
.delete(`/api/v1/meta/bases/${base.id}/shared`) .delete(`/api/v1/db/meta/projects/${base.id}/shared`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send() .send()
.expect(200); .expect(200);
@ -280,7 +278,7 @@ function baseTest() {
it('Meta diff sync', async () => { it('Meta diff sync', async () => {
await request(context.app) await request(context.app)
.get(`/api/v1/meta/bases/${base.id}/meta-diff`) .get(`/api/v1/db/meta/projects/${base.id}/meta-diff`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send() .send()
.expect(200); .expect(200);
@ -288,7 +286,7 @@ function baseTest() {
it('Meta diff sync', async () => { it('Meta diff sync', async () => {
await request(context.app) await request(context.app)
.post(`/api/v1/meta/bases/${base.id}/meta-diff`) .post(`/api/v1/db/meta/projects/${base.id}/meta-diff`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send() .send()
.expect(200); .expect(200);
@ -297,7 +295,7 @@ function baseTest() {
// todo: improve test. Check whether the all the actions are present in the response and correct as well // todo: improve test. Check whether the all the actions are present in the response and correct as well
it('Meta diff sync', async () => { it('Meta diff sync', async () => {
await request(context.app) await request(context.app)
.get(`/api/v1/meta/bases/${base.id}/audits`) .get(`/api/v1/db/meta/projects/${base.id}/audits`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send() .send()
.expect(200); .expect(200);

4
packages/nocodb/tests/unit/rest/tests/columnTypeSpecific.test.ts

@ -57,7 +57,7 @@ function columnTypeSpecificTests() {
describe('Qr Code Column', () => { describe('Qr Code Column', () => {
it('delivers the same cell values as the referenced column', async () => { it('delivers the same cell values as the referenced column', async () => {
const resp = await request(context.app) const resp = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
expect(resp.body.list[0][qrValueReferenceColumnTitle]).to.eql( expect(resp.body.list[0][qrValueReferenceColumnTitle]).to.eql(
@ -80,7 +80,7 @@ function columnTypeSpecificTests() {
).to.eq(true); ).to.eq(true);
const response = await request(context.app) const response = await request(context.app)
.delete(`/api/v1/meta/columns/${qrValueReferenceColumn.id}`) .delete(`/api/v1/db/meta/columns/${qrValueReferenceColumn.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({}); .send({});

4
packages/nocodb/tests/unit/rest/tests/filter.test.ts

@ -147,7 +147,7 @@ async function retrieveRecordsAndValidate(
// retrieve filtered records // retrieve filtered records
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${base.id}/${table.id}`) .get(`/api/v1/db/data/noco/${base.id}/${table.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
filterArrJson: JSON.stringify([filter]), filterArrJson: JSON.stringify([filter]),
@ -586,7 +586,7 @@ function filterSelectBased() {
async function applyDateFilter(filterParams, expectedRecords) { async function applyDateFilter(filterParams, expectedRecords) {
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${base.id}/${table.id}`) .get(`/api/v1/db/data/noco/${base.id}/${table.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
filterArrJson: JSON.stringify([filterParams]), filterArrJson: JSON.stringify([filterParams]),

32
packages/nocodb/tests/unit/rest/tests/groupby.test.ts

@ -34,7 +34,7 @@ function groupByTests() {
const columns = ( const columns = (
await request(context.app) await request(context.app)
.get(`/api/v1/meta/views/${filmView.id}/columns`) .get(`/api/v1/db/meta/views/${filmView.id}/columns`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200) .expect(200)
).body.list; ).body.list;
@ -45,7 +45,7 @@ function groupByTests() {
it('Check One GroupBy Column Ascending', async function () { it('Check One GroupBy Column Ascending', async function () {
const lengthColumn = filmColumns.find((c) => c.column_name === 'length'); const lengthColumn = filmColumns.find((c) => c.column_name === 'length');
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
column_name: lengthColumn.column_name, column_name: lengthColumn.column_name,
@ -65,7 +65,7 @@ function groupByTests() {
); );
const filterCondition = '(Length,eq,46)'; const filterCondition = '(Length,eq,46)';
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
column_name: rentalDurationColumn.column_name, column_name: rentalDurationColumn.column_name,
@ -84,7 +84,7 @@ function groupByTests() {
const titleColumn = filmColumns.find((c) => c.column_name === 'title'); const titleColumn = filmColumns.find((c) => c.column_name === 'title');
const filterCondition = '(Length,eq,46)~and(RentalDuration,eq,5)'; const filterCondition = '(Length,eq,46)~and(RentalDuration,eq,5)';
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
column_name: titleColumn.column_name, column_name: titleColumn.column_name,
@ -102,7 +102,7 @@ function groupByTests() {
it('Check One GroupBy Column With Descending', async function () { it('Check One GroupBy Column With Descending', async function () {
const lengthColumn = filmColumns.find((c) => c.column_name === 'length'); const lengthColumn = filmColumns.find((c) => c.column_name === 'length');
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
column_name: lengthColumn.column_name, column_name: lengthColumn.column_name,
@ -122,7 +122,7 @@ function groupByTests() {
); );
const filterCondition = '(Length,eq,46)'; const filterCondition = '(Length,eq,46)';
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
column_name: rentalDurationColumn.column_name, column_name: rentalDurationColumn.column_name,
@ -141,7 +141,7 @@ function groupByTests() {
const titleColumn = filmColumns.find((c) => c.column_name === 'title'); const titleColumn = filmColumns.find((c) => c.column_name === 'title');
const filterCondition = '(Length,eq,46)~and(RentalDuration,eq,5)'; const filterCondition = '(Length,eq,46)~and(RentalDuration,eq,5)';
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
column_name: titleColumn.column_name, column_name: titleColumn.column_name,
@ -172,7 +172,7 @@ function groupByTests() {
// Group By Length Column Ascending Order // Group By Length Column Ascending Order
await request(context.app) await request(context.app)
.patch(`/api/v1/meta/grid-columns/${lengthColumn.id}`) .patch(`/api/v1/db/meta/grid-columns/${lengthColumn.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
group_by: true, group_by: true,
@ -182,7 +182,7 @@ function groupByTests() {
.expect(200); .expect(200);
// Group By RentalDuration Column Descending // Group By RentalDuration Column Descending
await request(context.app) await request(context.app)
.patch(`/api/v1/meta/grid-columns/${rentalColumn.id}`) .patch(`/api/v1/db/meta/grid-columns/${rentalColumn.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
group_by: true, group_by: true,
@ -192,7 +192,7 @@ function groupByTests() {
.expect(200); .expect(200);
const columns = ( const columns = (
await request(context.app) await request(context.app)
.get(`/api/v1/meta/views/${filmView.id}/columns`) .get(`/api/v1/db/meta/views/${filmView.id}/columns`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200) .expect(200)
).body.list; ).body.list;
@ -226,7 +226,7 @@ function groupByTests() {
], ],
}); });
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
column_name: _lengthColumn.column_name, column_name: _lengthColumn.column_name,
@ -243,7 +243,7 @@ function groupByTests() {
it('Check One GroupBy Column with Links/Rollup', async function () { it('Check One GroupBy Column with Links/Rollup', async function () {
const actorsColumn = filmColumns.find((c) => c.title === 'Actors'); const actorsColumn = filmColumns.find((c) => c.title === 'Actors');
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
column_name: actorsColumn.title, column_name: actorsColumn.title,
@ -285,7 +285,7 @@ function groupByTests() {
}); });
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
column_name: 'LanguageName', column_name: 'LanguageName',
@ -307,7 +307,7 @@ function groupByTests() {
}); });
const res = await request(context.app) const res = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
column_name: 'ActorNames', column_name: 'ActorNames',
@ -326,7 +326,7 @@ function groupByTests() {
}); });
const res = await request(context.app) const res = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
column_name: formulaColumnTitle, column_name: formulaColumnTitle,
@ -349,7 +349,7 @@ function groupByTests() {
}); });
const res1 = await request(context.app) const res1 = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
column_name: nestedFormulaColumnTitle, column_name: nestedFormulaColumnTitle,

34
packages/nocodb/tests/unit/rest/tests/org.test.ts

@ -25,7 +25,7 @@ function authTests() {
it('Get users list', async () => { it('Get users list', async () => {
const response = await request(context.app) const response = await request(context.app)
.get('/api/v1/users') .get('/api/v1/db/users')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -35,7 +35,7 @@ function authTests() {
it('Invite a new user', async () => { it('Invite a new user', async () => {
const response = await request(context.app) const response = await request(context.app)
.post('/api/v1/users') .post('/api/v1/db/users')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ email: 'a@nocodb.com' }) .send({ email: 'a@nocodb.com' })
.expect(200); .expect(200);
@ -50,12 +50,12 @@ function authTests() {
const email = 'a@nocodb.com'; const email = 'a@nocodb.com';
// invite a user // invite a user
await request(context.app) await request(context.app)
.post('/api/v1/users') .post('/api/v1/db/users')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ email }) .send({ email })
.expect(200); .expect(200);
const response = await request(context.app) const response = await request(context.app)
.get('/api/v1/users') .get('/api/v1/db/users')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
expect(response.body.list).to.have.length(2); expect(response.body.list).to.have.length(2);
@ -65,13 +65,13 @@ function authTests() {
expect(user).to.have.property('roles').to.be.equal(OrgUserRoles.VIEWER); expect(user).to.have.property('roles').to.be.equal(OrgUserRoles.VIEWER);
await request(context.app) await request(context.app)
.patch('/api/v1/users/' + user.id) .patch('/api/v1/db/users/' + user.id)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ roles: OrgUserRoles.CREATOR }) .send({ roles: OrgUserRoles.CREATOR })
.expect(200); .expect(200);
const response2 = await request(context.app) const response2 = await request(context.app)
.get('/api/v1/users') .get('/api/v1/db/users')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
expect(response2.body.list).to.have.length(2); expect(response2.body.list).to.have.length(2);
@ -85,13 +85,13 @@ function authTests() {
const email = 'a@nocodb.com'; const email = 'a@nocodb.com';
// invite a user // invite a user
await request(context.app) await request(context.app)
.post('/api/v1/users') .post('/api/v1/db/users')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ email }) .send({ email })
.expect(200); .expect(200);
const response = await request(context.app) const response = await request(context.app)
.get('/api/v1/users') .get('/api/v1/db/users')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
expect(response.body.list).to.have.length(2); expect(response.body.list).to.have.length(2);
@ -101,12 +101,12 @@ function authTests() {
expect(user).to.have.property('roles').to.be.equal(OrgUserRoles.VIEWER); expect(user).to.have.property('roles').to.be.equal(OrgUserRoles.VIEWER);
await request(context.app) await request(context.app)
.delete('/api/v1/users/' + user.id) .delete('/api/v1/db/users/' + user.id)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
const response2 = await request(context.app) const response2 = await request(context.app)
.get('/api/v1/users') .get('/api/v1/db/users')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
expect(response2.body.list).to.have.length(1); expect(response2.body.list).to.have.length(1);
@ -114,7 +114,7 @@ function authTests() {
it('Get token list', async () => { it('Get token list', async () => {
const response = await request(context.app) const response = await request(context.app)
.get('/api/v1/tokens') .get('/api/v1/db/tokens')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -124,13 +124,13 @@ function authTests() {
it('Generate token', async () => { it('Generate token', async () => {
const r = await request(context.app) const r = await request(context.app)
.post('/api/v1/tokens') .post('/api/v1/db/tokens')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ description: 'test' }) .send({ description: 'test' })
.expect(200); .expect(200);
const response = await request(context.app) const response = await request(context.app)
.get('/api/v1/tokens') .get('/api/v1/db/tokens')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -145,13 +145,13 @@ function authTests() {
it('Delete token', async () => { it('Delete token', async () => {
const r = await request(context.app) const r = await request(context.app)
.post('/api/v1/tokens') .post('/api/v1/db/tokens')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ description: 'test' }) .send({ description: 'test' })
.expect(200); .expect(200);
let response = await request(context.app) let response = await request(context.app)
.get('/api/v1/tokens') .get('/api/v1/db/tokens')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -159,12 +159,12 @@ function authTests() {
expect(response.body.list).to.have.length(1); expect(response.body.list).to.have.length(1);
await request(context.app) await request(context.app)
.delete('/api/v1/tokens/' + r.body.token) .delete('/api/v1/db/tokens/' + r.body.token)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
response = await request(context.app) response = await request(context.app)
.get('/api/v1/tokens') .get('/api/v1/db/tokens')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);

34
packages/nocodb/tests/unit/rest/tests/table.test.ts

@ -40,7 +40,7 @@ function tableStaticTests() {
it('Get table list', async function () { it('Get table list', async function () {
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/meta/bases/${base.id}/tables`) .get(`/api/v1/db/meta/projects/${base.id}/tables`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({}) .send({})
.expect(200); .expect(200);
@ -50,7 +50,7 @@ function tableStaticTests() {
it('Create table with no table name', async function () { it('Create table with no table name', async function () {
const response = await request(context.app) const response = await request(context.app)
.post(`/api/v1/meta/bases/${base.id}/tables`) .post(`/api/v1/db/meta/projects/${base.id}/tables`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
table_name: undefined, table_name: undefined,
@ -79,7 +79,7 @@ function tableStaticTests() {
it('Create table with same table name', async function () { it('Create table with same table name', async function () {
const response = await request(context.app) const response = await request(context.app)
.post(`/api/v1/meta/bases/${base.id}/tables`) .post(`/api/v1/db/meta/projects/${base.id}/tables`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
table_name: table.table_name, table_name: table.table_name,
@ -101,7 +101,7 @@ function tableStaticTests() {
it('Create table with same title', async function () { it('Create table with same title', async function () {
const response = await request(context.app) const response = await request(context.app)
.post(`/api/v1/meta/bases/${base.id}/tables`) .post(`/api/v1/db/meta/projects/${base.id}/tables`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
table_name: 'New_table_name', table_name: 'New_table_name',
@ -123,7 +123,7 @@ function tableStaticTests() {
it('Create table with title length more than the limit', async function () { it('Create table with title length more than the limit', async function () {
const response = await request(context.app) const response = await request(context.app)
.post(`/api/v1/meta/bases/${base.id}/tables`) .post(`/api/v1/db/meta/projects/${base.id}/tables`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
table_name: 'a'.repeat(256), table_name: 'a'.repeat(256),
@ -145,7 +145,7 @@ function tableStaticTests() {
it('Create table with title having leading white space', async function () { it('Create table with title having leading white space', async function () {
const response = await request(context.app) const response = await request(context.app)
.post(`/api/v1/meta/bases/${base.id}/tables`) .post(`/api/v1/db/meta/projects/${base.id}/tables`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
table_name: 'table_name_with_whitespace ', table_name: 'table_name_with_whitespace ',
@ -186,7 +186,7 @@ function tableTest() {
it('Create table', async function () { it('Create table', async function () {
const response = await request(context.app) const response = await request(context.app)
.post(`/api/v1/meta/bases/${base.id}/tables`) .post(`/api/v1/db/meta/projects/${base.id}/tables`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
table_name: 'table2', table_name: 'table2',
@ -216,7 +216,7 @@ function tableTest() {
it('Update table', async function () { it('Update table', async function () {
const response = await request(context.app) const response = await request(context.app)
.patch(`/api/v1/meta/tables/${table.id}`) .patch(`/api/v1/db/meta/tables/${table.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
base_id: base.id, base_id: base.id,
@ -232,7 +232,7 @@ function tableTest() {
it('Delete table', async function () { it('Delete table', async function () {
const response = await request(context.app) const response = await request(context.app)
.delete(`/api/v1/meta/tables/${table.id}`) .delete(`/api/v1/db/meta/tables/${table.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({}) .send({})
.expect(200); .expect(200);
@ -249,7 +249,7 @@ function tableTest() {
it('Get table', async function () { it('Get table', async function () {
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/meta/tables/${table.id}`) .get(`/api/v1/db/meta/tables/${table.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({}) .send({})
.expect(200); .expect(200);
@ -261,7 +261,7 @@ function tableTest() {
it('Reorder table', async function () { it('Reorder table', async function () {
const newOrder = table.order === 0 ? 1 : 0; const newOrder = table.order === 0 ? 1 : 0;
const response = await request(context.app) const response = await request(context.app)
.post(`/api/v1/meta/tables/${table.id}/reorder`) .post(`/api/v1/db/meta/tables/${table.id}/reorder`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
order: newOrder, order: newOrder,
@ -282,7 +282,7 @@ function tableTest() {
it('Add and delete view should update hasNonDefaultViews', async () => { it('Add and delete view should update hasNonDefaultViews', async () => {
let response = await request(context.app) let response = await request(context.app)
.get(`/api/v1/meta/bases/${base.id}/tables`) .get(`/api/v1/db/meta/projects/${base.id}/tables`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({}) .send({})
.expect(200); .expect(200);
@ -296,7 +296,7 @@ function tableTest() {
}); });
response = await request(context.app) response = await request(context.app)
.get(`/api/v1/meta/bases/${base.id}/tables`) .get(`/api/v1/db/meta/projects/${base.id}/tables`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({}) .send({})
.expect(200); .expect(200);
@ -306,7 +306,7 @@ function tableTest() {
await deleteView(context, { viewId: view.id }); await deleteView(context, { viewId: view.id });
response = await request(context.app) response = await request(context.app)
.get(`/api/v1/meta/bases/${base.id}/tables`) .get(`/api/v1/db/meta/projects/${base.id}/tables`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({}) .send({})
.expect(200); .expect(200);
@ -316,7 +316,7 @@ function tableTest() {
it('Project with empty meta should update hasNonDefaultViews', async () => { it('Project with empty meta should update hasNonDefaultViews', async () => {
let response = await request(context.app) let response = await request(context.app)
.get(`/api/v1/meta/bases/${base.id}/tables`) .get(`/api/v1/db/meta/projects/${base.id}/tables`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({}) .send({})
.expect(200); .expect(200);
@ -337,7 +337,7 @@ function tableTest() {
}); });
response = await request(context.app) response = await request(context.app)
.get(`/api/v1/meta/bases/${base.id}/tables`) .get(`/api/v1/db/meta/projects/${base.id}/tables`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({}) .send({})
.expect(200); .expect(200);
@ -347,7 +347,7 @@ function tableTest() {
await deleteView(context, { viewId: view.id }); await deleteView(context, { viewId: view.id });
response = await request(context.app) response = await request(context.app)
.get(`/api/v1/meta/bases/${base.id}/tables`) .get(`/api/v1/db/meta/projects/${base.id}/tables`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({}) .send({})
.expect(200); .expect(200);

172
packages/nocodb/tests/unit/rest/tests/tableRow.test.ts

@ -60,7 +60,7 @@ function tableStaticTest() {
it('Get table data list', async function () { it('Get table data list', async function () {
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({}) .send({})
.expect(200); .expect(200);
@ -79,7 +79,7 @@ function tableStaticTest() {
const requiredColumns = customerColumns.filter((_, index) => index < 3); const requiredColumns = customerColumns.filter((_, index) => index < 3);
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
fields: requiredColumns.map((c) => c.title), fields: requiredColumns.map((c) => c.title),
@ -104,7 +104,7 @@ function tableStaticTest() {
const sortInfo = [{ fk_column_id: firstNameColumn.id, direction: 'desc' }]; const sortInfo = [{ fk_column_id: firstNameColumn.id, direction: 'desc' }];
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
fields: visibleColumns.map((c) => c.title), fields: visibleColumns.map((c) => c.title),
@ -131,7 +131,7 @@ function tableStaticTest() {
const lastPageOffset = const lastPageOffset =
Math.trunc(pageInfo.totalRows / pageInfo.pageSize) * pageInfo.pageSize; Math.trunc(pageInfo.totalRows / pageInfo.pageSize) * pageInfo.pageSize;
const lastPageResponse = await request(context.app) const lastPageResponse = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
fields: visibleColumns.map((c) => c.title), fields: visibleColumns.map((c) => c.title),
@ -157,7 +157,7 @@ function tableStaticTest() {
const sortInfo = [{ fk_column_id: firstNameColumn.id, direction: 'asc' }]; const sortInfo = [{ fk_column_id: firstNameColumn.id, direction: 'asc' }];
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
fields: visibleColumns.map((c) => c.title), fields: visibleColumns.map((c) => c.title),
@ -184,7 +184,7 @@ function tableStaticTest() {
const lastPageOffset = const lastPageOffset =
Math.trunc(pageInfo.totalRows / pageInfo.pageSize) * pageInfo.pageSize; Math.trunc(pageInfo.totalRows / pageInfo.pageSize) * pageInfo.pageSize;
const lastPageResponse = await request(context.app) const lastPageResponse = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
fields: visibleColumns.map((c) => c.title), fields: visibleColumns.map((c) => c.title),
@ -204,7 +204,7 @@ function tableStaticTest() {
}); });
it('Create table row with wrong table id', async function () { it('Create table row with wrong table id', async function () {
const response = await request(context.app) const response = await request(context.app)
.post(`/api/v1/data/noco/${base.id}/wrong-table-id`) .post(`/api/v1/db/data/noco/${base.id}/wrong-table-id`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
title: 'Test', title: 'Test',
@ -222,7 +222,7 @@ function tableStaticTest() {
let response = await request(context.app) let response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/find-one`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/find-one`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -243,7 +243,7 @@ function tableStaticTest() {
response = await request(context.app) response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/find-one`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/find-one`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -264,7 +264,7 @@ function tableStaticTest() {
}); });
it('Read table row', async function () { it('Read table row', async function () {
const listResponse = await request(context.app) const listResponse = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -272,7 +272,7 @@ function tableStaticTest() {
const readResponse = await request(context.app) const readResponse = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${row['CustomerId']}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${row['CustomerId']}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -292,7 +292,7 @@ function tableStaticTest() {
}); });
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/`, `/api/v1/db/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -311,7 +311,7 @@ function tableStaticTest() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${row['CustomerId']}/exist`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${row['CustomerId']}/exist`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -323,7 +323,7 @@ function tableStaticTest() {
it('Exist should be false table row when it does not exists', async function () { it('Exist should be false table row when it does not exists', async function () {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/998546/exist`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/998546/exist`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -336,7 +336,7 @@ function tableStaticTest() {
it('Export csv', async () => { it('Export csv', async () => {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.title}/export/csv`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.title}/export/csv`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -354,7 +354,7 @@ function tableStaticTest() {
it('Export excel', async () => { it('Export excel', async () => {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.title}/export/excel`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.title}/export/excel`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -378,7 +378,7 @@ function tableStaticTest() {
)!; )!;
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -396,7 +396,7 @@ function tableStaticTest() {
)!; )!;
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -421,7 +421,7 @@ function tableStaticTest() {
)!; )!;
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/wrong-id/${rowId}/hm/${rentalListColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/wrong-id/${rowId}/hm/${rentalListColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(404); .expect(404);
@ -442,7 +442,7 @@ function tableStaticTest() {
)!; )!;
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -465,7 +465,7 @@ function tableStaticTest() {
)!; )!;
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -495,7 +495,7 @@ function tableStaticTest() {
)!; )!;
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/invalid-table-id/${rowId}/mm/${filmListColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/invalid-table-id/${rowId}/mm/${filmListColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(404); .expect(404);
@ -513,7 +513,7 @@ function tableStaticTest() {
const refId = 1; const refId = 1;
const response = await request(context.app) const response = await request(context.app)
.post( .post(
`/api/v1/data/noco/${sakilaProject.id}/invalid-table-id/${rowId}/hm/${rentalListColumn.id}/${refId}`, `/api/v1/db/data/noco/${sakilaProject.id}/invalid-table-id/${rowId}/hm/${rentalListColumn.id}/${refId}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(404); .expect(404);
@ -530,7 +530,7 @@ function tableStaticTest() {
const refId = 1; const refId = 1;
const response = await request(context.app) const response = await request(context.app)
.post( .post(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${firstNameColumn.id}/${refId}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${firstNameColumn.id}/${refId}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(404); .expect(404);
@ -546,7 +546,7 @@ function tableStaticTest() {
const response = await request(context.app) const response = await request(context.app)
.post( .post(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/invalid-column/${refId}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/invalid-column/${refId}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(404); .expect(404);
@ -566,7 +566,7 @@ function tableStaticTest() {
await request(context.app) await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${firstNameColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${firstNameColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(400); .expect(400);
@ -579,7 +579,7 @@ function tableStaticTest() {
await request(context.app) await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/mm/${firstNameColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/mm/${firstNameColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(400); .expect(400);
@ -592,7 +592,7 @@ function tableStaticTest() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}/exclude`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}/exclude`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -610,7 +610,7 @@ function tableStaticTest() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}/exclude`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}/exclude`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -641,7 +641,7 @@ function tableStaticTest() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}/exclude`, `/api/v1/db/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}/exclude`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -663,7 +663,7 @@ function tableStaticTest() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}/exclude`, `/api/v1/db/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}/exclude`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -694,7 +694,7 @@ function tableStaticTest() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${addressTable.id}/${rowId}/bt/${cityColumn.id}/exclude`, `/api/v1/db/data/noco/${sakilaProject.id}/${addressTable.id}/${rowId}/bt/${cityColumn.id}/exclude`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -714,7 +714,7 @@ function tableStaticTest() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${addressTable.id}/${rowId}/bt/${cityColumn.id}/exclude`, `/api/v1/db/data/noco/${sakilaProject.id}/${addressTable.id}/${rowId}/bt/${cityColumn.id}/exclude`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -735,7 +735,7 @@ function tableStaticTest() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/Film/group/${ratingColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/Film/group/${ratingColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -792,7 +792,7 @@ function tableTest() {
}); });
const ascResponse = await request(context.app) const ascResponse = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
sortArrJson: JSON.stringify([ sortArrJson: JSON.stringify([
@ -804,7 +804,7 @@ function tableTest() {
throw new Error('Wrong sort'); throw new Error('Wrong sort');
const descResponse = await request(context.app) const descResponse = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
sortArrJson: JSON.stringify([ sortArrJson: JSON.stringify([
@ -831,7 +831,7 @@ function tableTest() {
}); });
const ascResponse = await request(context.app) const ascResponse = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${rentalTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${rentalTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
sortArrJson: JSON.stringify([ sortArrJson: JSON.stringify([
@ -844,7 +844,7 @@ function tableTest() {
throw new Error('Wrong sort'); throw new Error('Wrong sort');
const descResponse = await request(context.app) const descResponse = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${rentalTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${rentalTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
sortArrJson: JSON.stringify([ sortArrJson: JSON.stringify([
@ -879,7 +879,7 @@ function tableTest() {
}; };
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${rentalTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${rentalTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
filterArrJson: JSON.stringify([filter]), filterArrJson: JSON.stringify([filter]),
@ -914,7 +914,7 @@ function tableTest() {
}; };
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
filterArrJson: JSON.stringify([filter]), filterArrJson: JSON.stringify([filter]),
@ -957,7 +957,7 @@ function tableTest() {
}; };
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${rentalTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${rentalTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
filterArrJson: JSON.stringify([nestedFilter]), filterArrJson: JSON.stringify([nestedFilter]),
@ -967,7 +967,7 @@ function tableTest() {
expect(response.body.pageInfo.totalRows).equal(9558); expect(response.body.pageInfo.totalRows).equal(9558);
const ascResponse = await request(context.app) const ascResponse = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${rentalTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${rentalTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
filterArrJson: JSON.stringify([nestedFilter]), filterArrJson: JSON.stringify([nestedFilter]),
@ -984,7 +984,7 @@ function tableTest() {
expect(ascResponse.body.list[0][lookupColumn.title]).equal('AARON'); expect(ascResponse.body.list[0][lookupColumn.title]).equal('AARON');
const descResponse = await request(context.app) const descResponse = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${rentalTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${rentalTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
filterArrJson: JSON.stringify([nestedFilter]), filterArrJson: JSON.stringify([nestedFilter]),
@ -1051,7 +1051,7 @@ function tableTest() {
}; };
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${rentalTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${rentalTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
filterArrJson: JSON.stringify([nestedFilter]), filterArrJson: JSON.stringify([nestedFilter]),
@ -1067,7 +1067,7 @@ function tableTest() {
throw new Error('Wrong filter'); throw new Error('Wrong filter');
const ascResponse = await request(context.app) const ascResponse = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${rentalTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${rentalTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
filterArrJson: JSON.stringify([nestedFilter]), filterArrJson: JSON.stringify([nestedFilter]),
@ -1091,7 +1091,7 @@ function tableTest() {
} }
const descResponse = await request(context.app) const descResponse = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${rentalTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${rentalTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
filterArrJson: JSON.stringify([nestedFilter]), filterArrJson: JSON.stringify([nestedFilter]),
@ -1180,7 +1180,7 @@ function tableTest() {
]; ];
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
filterArrJson: JSON.stringify([nestedFilter]), filterArrJson: JSON.stringify([nestedFilter]),
@ -1198,7 +1198,7 @@ function tableTest() {
} }
const ascResponse = await request(context.app) const ascResponse = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
filterArrJson: JSON.stringify([nestedFilter]), filterArrJson: JSON.stringify([nestedFilter]),
@ -1234,7 +1234,7 @@ function tableTest() {
} }
const descResponse = await request(context.app) const descResponse = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
filterArrJson: JSON.stringify([nestedFilter]), filterArrJson: JSON.stringify([nestedFilter]),
@ -1327,7 +1327,7 @@ function tableTest() {
]; ];
const ascResponse = await request(context.app) const ascResponse = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
nested: nestedFields, nested: nestedFields,
@ -1383,7 +1383,7 @@ function tableTest() {
}); });
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
sortArrJson: JSON.stringify([ sortArrJson: JSON.stringify([
@ -1440,7 +1440,7 @@ function tableTest() {
// console.log(formulaColumn); // console.log(formulaColumn);
// const response = await request(context.app) // const response = await request(context.app)
// .get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) // .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
// .set('xc-auth', context.token) // .set('xc-auth', context.token)
// .query({ // .query({
// sortArrJson: JSON.stringify([ // sortArrJson: JSON.stringify([
@ -1459,7 +1459,7 @@ function tableTest() {
const table = await createTable(context, base); const table = await createTable(context, base);
const response = await request(context.app) const response = await request(context.app)
.post(`/api/v1/data/noco/${base.id}/${table.id}`) .post(`/api/v1/db/data/noco/${base.id}/${table.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
title: 'Test', title: 'Test',
@ -1489,7 +1489,7 @@ function tableTest() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/find-one`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/find-one`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -1569,7 +1569,7 @@ function tableTest() {
const ascResponse = await request(context.app) const ascResponse = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/find-one`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/find-one`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -1613,7 +1613,7 @@ function tableTest() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/groupby`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/groupby`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -1649,7 +1649,7 @@ function tableTest() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/groupby`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/groupby`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -1672,7 +1672,7 @@ function tableTest() {
const row = await createRow(context, { base, table }); const row = await createRow(context, { base, table });
const updateResponse = await request(context.app) const updateResponse = await request(context.app)
.patch(`/api/v1/data/noco/${base.id}/${table.id}/${row['Id']}`) .patch(`/api/v1/db/data/noco/${base.id}/${table.id}/${row['Id']}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
title: 'Updated', title: 'Updated',
@ -1697,7 +1697,7 @@ function tableTest() {
const row = await createRow(context, { base, table }); const row = await createRow(context, { base, table });
await request(context.app) await request(context.app)
.patch(`/api/v1/data/noco/${base.id}/${table.id}/${row['Id']}`) .patch(`/api/v1/db/data/noco/${base.id}/${table.id}/${row['Id']}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
[emailColumn.column_name]: 'invalidemail', [emailColumn.column_name]: 'invalidemail',
@ -1721,7 +1721,7 @@ function tableTest() {
const row = await createRow(context, { base, table }); const row = await createRow(context, { base, table });
const response = await request(context.app) const response = await request(context.app)
.patch(`/api/v1/data/noco/${base.id}/${table.id}/${row['Id']}`) .patch(`/api/v1/db/data/noco/${base.id}/${table.id}/${row['Id']}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
[emailColumn.column_name]: 'valid@example.com', [emailColumn.column_name]: 'valid@example.com',
@ -1743,7 +1743,7 @@ function tableTest() {
const row = await createRow(context, { base, table }); const row = await createRow(context, { base, table });
await request(context.app) await request(context.app)
.delete(`/api/v1/data/noco/${base.id}/${table.id}/${row['Id']}`) .delete(`/api/v1/db/data/noco/${base.id}/${table.id}/${row['Id']}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -1779,7 +1779,7 @@ function tableTest() {
}); });
await request(context.app) await request(context.app)
.delete(`/api/v1/data/noco/${base.id}/${table.id}/${row['Id']}`) .delete(`/api/v1/db/data/noco/${base.id}/${table.id}/${row['Id']}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -1798,7 +1798,7 @@ function tableTest() {
.map((index) => generateDefaultRowAttributes({ columns, index })); .map((index) => generateDefaultRowAttributes({ columns, index }));
const response = await request(context.app) const response = await request(context.app)
.post(`/api/v1/data/bulk/noco/${base.id}/${table.id}`) .post(`/api/v1/db/data/bulk/noco/${base.id}/${table.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send(rowAttributes) .send(rowAttributes)
.expect(200); .expect(200);
@ -1835,7 +1835,7 @@ function tableTest() {
.map((index) => generateDefaultRowAttributes({ columns, index })); .map((index) => generateDefaultRowAttributes({ columns, index }));
const response = await request(context.app) const response = await request(context.app)
.post(`/api/v1/data/bulk/noco/${base.id}/${table.id}`) .post(`/api/v1/db/data/bulk/noco/${base.id}/${table.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send(rowAttributes) .send(rowAttributes)
.expect(200); .expect(200);
@ -1883,7 +1883,7 @@ function tableTest() {
const rows = await listRow({ base, table }); const rows = await listRow({ base, table });
await request(context.app) await request(context.app)
.patch(`/api/v1/data/bulk/noco/${base.id}/${table.id}`) .patch(`/api/v1/db/data/bulk/noco/${base.id}/${table.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send( .send(
rows.map((row) => ({ title: `new-${row['Title']}`, id: row['Id'] })), rows.map((row) => ({ title: `new-${row['Title']}`, id: row['Id'] })),
@ -1912,7 +1912,7 @@ function tableTest() {
const rows = await listRow({ base, table }); const rows = await listRow({ base, table });
await request(context.app) await request(context.app)
.delete(`/api/v1/data/bulk/noco/${base.id}/${table.id}`) .delete(`/api/v1/db/data/bulk/noco/${base.id}/${table.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send(rows.map((row) => ({ id: row['Id'] }))) .send(rows.map((row) => ({ id: row['Id'] })))
.expect(200); .expect(200);
@ -1939,7 +1939,7 @@ function tableTest() {
// const rows = await listRow({ base, table }); // const rows = await listRow({ base, table });
// await request(context.app) // await request(context.app)
// .delete(`/api/v1/data/bulk/noco/${base.id}/${table.id}/all`) // .delete(`/api/v1/db/data/bulk/noco/${base.id}/${table.id}/all`)
// .set('xc-auth', context.token) // .set('xc-auth', context.token)
// .query({ filterArr: [ // .query({ filterArr: [
// { // {
@ -1976,7 +1976,7 @@ function tableTest() {
// (column) => column.title === 'Rentals' // (column) => column.title === 'Rentals'
// )!; // )!;
// const response = await request(context.app) // const response = await request(context.app)
// .get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}`) // .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}`)
// .query({ // .query({
// fields: visibleColumns.map((c) => c.title), // fields: visibleColumns.map((c) => c.title),
// }) // })
@ -2002,12 +2002,12 @@ function tableTest() {
// const refId = 1; // const refId = 1;
// await request(context.app) // await request(context.app)
// .post(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}/${refId}`) // .post(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}/${refId}`)
// .set('xc-auth', context.token) // .set('xc-auth', context.token)
// .expect(400) // .expect(400)
// await request(context.app) // await request(context.app)
// .post(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}/${refId}`) // .post(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}/${refId}`)
// .set('xc-auth', context.token) // .set('xc-auth', context.token)
// .expect(400) // .expect(400)
// }) // })
@ -2021,14 +2021,14 @@ function tableTest() {
const lisResponseBeforeUpdate = await request(context.app) const lisResponseBeforeUpdate = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
await request(context.app) await request(context.app)
.post( .post(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}/${refId}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}/${refId}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -2036,7 +2036,7 @@ function tableTest() {
const lisResponseAfterUpdate = await request(context.app) const lisResponseAfterUpdate = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -2059,7 +2059,7 @@ function tableTest() {
const response = await request(context.app) const response = await request(context.app)
.post( .post(
`/api/v1/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/invalid-column/${refId}`, `/api/v1/db/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/invalid-column/${refId}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(404); .expect(404);
@ -2084,7 +2084,7 @@ function tableTest() {
const refId = 1; const refId = 1;
const response = await request(context.app) const response = await request(context.app)
.post( .post(
`/api/v1/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${firstNameColumn.id}/${refId}`, `/api/v1/db/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${firstNameColumn.id}/${refId}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(404); .expect(404);
@ -2108,7 +2108,7 @@ function tableTest() {
await request(context.app) await request(context.app)
.post( .post(
`/api/v1/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}/${refId}`, `/api/v1/db/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}/${refId}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(400); .expect(400);
@ -2130,14 +2130,14 @@ function tableTest() {
const lisResponseBeforeUpdate = await request(context.app) const lisResponseBeforeUpdate = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
await request(context.app) await request(context.app)
.post( .post(
`/api/v1/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}/${refId}`, `/api/v1/db/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}/${refId}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -2145,7 +2145,7 @@ function tableTest() {
const lisResponseAfterUpdate = await request(context.app) const lisResponseAfterUpdate = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -2171,14 +2171,14 @@ function tableTest() {
const lisResponseBeforeDelete = await request(context.app) const lisResponseBeforeDelete = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
await request(context.app) await request(context.app)
.delete( .delete(
`/api/v1/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}/${refId}`, `/api/v1/db/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}/${refId}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -2186,7 +2186,7 @@ function tableTest() {
const lisResponseAfterDelete = await request(context.app) const lisResponseAfterDelete = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -2211,7 +2211,7 @@ function tableTest() {
const response = await request(context.app) const response = await request(context.app)
.delete( .delete(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}/${refId}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}/${refId}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(400); .expect(400);
@ -2259,7 +2259,7 @@ function tableTest() {
const childRow = (await listRow({ base, table: relatedTable }))[0]; const childRow = (await listRow({ base, table: relatedTable }))[0];
const response = await request(context.app) const response = await request(context.app)
.delete( .delete(
`/api/v1/data/noco/${base.id}/${table.id}/${row['Id']}/hm/${ltarColumn.id}/${childRow['Id']}`, `/api/v1/db/data/noco/${base.id}/${table.id}/${row['Id']}/hm/${ltarColumn.id}/${childRow['Id']}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -2286,7 +2286,7 @@ function tableTest() {
const response = await request(context.app) const response = await request(context.app)
.post( .post(
`/api/v1/data/noco/${sakilaProject.id}/invalid-table-id/${rowId}/hm/${rentalListColumn.id}/exclude`, `/api/v1/db/data/noco/${sakilaProject.id}/invalid-table-id/${rowId}/hm/${rentalListColumn.id}/exclude`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(404); .expect(404);
@ -2308,7 +2308,7 @@ function tableTest() {
)!; )!;
const response = await request(context.app) const response = await request(context.app)
.post( .post(
`/api/v1/data/noco/${sakilaProject.id}/invalid-table-id/${rowId}/mm/${filmListColumn.id}/exclude`, `/api/v1/db/data/noco/${sakilaProject.id}/invalid-table-id/${rowId}/mm/${filmListColumn.id}/exclude`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(404); .expect(404);

66
packages/nocodb/tests/unit/rest/tests/viewRow.test.ts

@ -56,7 +56,7 @@ let filmKanbanView: View;
const testGetViewRowList = async (view: View) => { const testGetViewRowList = async (view: View) => {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -72,7 +72,7 @@ const testGetViewRowListKanban = async (view: View) => {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/views/${view.id}/group/${ratingColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/views/${view.id}/group/${ratingColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -155,7 +155,7 @@ function viewRowStaticTests() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -198,7 +198,7 @@ function viewRowStaticTests() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/views/${view.id}/group/${ratingColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/views/${view.id}/group/${ratingColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -230,7 +230,7 @@ function viewRowStaticTests() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -258,7 +258,7 @@ function viewRowStaticTests() {
Math.trunc(pageInfo.totalRows / pageInfo.pageSize) * pageInfo.pageSize; Math.trunc(pageInfo.totalRows / pageInfo.pageSize) * pageInfo.pageSize;
const lastPageResponse = await request(context.app) const lastPageResponse = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -298,7 +298,7 @@ function viewRowStaticTests() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/views/${view.id}/group/${ratingColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/views/${view.id}/group/${ratingColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -329,7 +329,7 @@ function viewRowStaticTests() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -357,7 +357,7 @@ function viewRowStaticTests() {
Math.trunc(pageInfo.totalRows / pageInfo.pageSize) * pageInfo.pageSize; Math.trunc(pageInfo.totalRows / pageInfo.pageSize) * pageInfo.pageSize;
const lastPageResponse = await request(context.app) const lastPageResponse = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -397,7 +397,7 @@ function viewRowStaticTests() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/views/${view.id}/group/${ratingColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/views/${view.id}/group/${ratingColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -498,7 +498,7 @@ function viewRowTests() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${rentalTable.id}/views/${view.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${rentalTable.id}/views/${view.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -509,7 +509,7 @@ function viewRowTests() {
const ascResponse = await request(context.app) const ascResponse = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${rentalTable.id}/views/${view.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${rentalTable.id}/views/${view.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -528,7 +528,7 @@ function viewRowTests() {
const descResponse = await request(context.app) const descResponse = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${rentalTable.id}/views/${view.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${rentalTable.id}/views/${view.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -620,7 +620,7 @@ function viewRowTests() {
const ascResponse = await request(context.app) const ascResponse = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -664,7 +664,7 @@ function viewRowTests() {
}); });
const response = await request(context.app) const response = await request(context.app)
.post(`/api/v1/data/noco/${base.id}/${table.id}/views/${view.id}`) .post(`/api/v1/db/data/noco/${base.id}/${table.id}/views/${view.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
title: 'Test', title: 'Test',
@ -701,7 +701,7 @@ function viewRowTests() {
await request(context.app) await request(context.app)
.post( .post(
`/api/v1/data/noco/${base.id}/${table.id}/views/${nonRelatedView.id}`, `/api/v1/db/data/noco/${base.id}/${table.id}/views/${nonRelatedView.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
@ -743,7 +743,7 @@ function viewRowTests() {
let response = await request(context.app) let response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/find-one`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/find-one`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -764,7 +764,7 @@ function viewRowTests() {
response = await request(context.app) response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/find-one`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/find-one`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -867,7 +867,7 @@ function viewRowTests() {
const ascResponse = await request(context.app) const ascResponse = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/find-one`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/find-one`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -929,7 +929,7 @@ function viewRowTests() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/groupby`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/groupby`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -980,7 +980,7 @@ function viewRowTests() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/groupby`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/groupby`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -1016,7 +1016,7 @@ function viewRowTests() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/count`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/count`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -1040,7 +1040,7 @@ function viewRowTests() {
const listResponse = await request(context.app) const listResponse = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -1049,7 +1049,7 @@ function viewRowTests() {
const readResponse = await request(context.app) const readResponse = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/${row['CustomerId']}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/${row['CustomerId']}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -1078,7 +1078,7 @@ function viewRowTests() {
const updateResponse = await request(context.app) const updateResponse = await request(context.app)
.patch( .patch(
`/api/v1/data/noco/${base.id}/${table.id}/views/${view.id}/${row['Id']}`, `/api/v1/db/data/noco/${base.id}/${table.id}/views/${view.id}/${row['Id']}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
@ -1122,7 +1122,7 @@ function viewRowTests() {
await request(context.app) await request(context.app)
.patch( .patch(
`/api/v1/data/noco/${base.id}/${table.id}/views/${view.id}/${row['Id']}`, `/api/v1/db/data/noco/${base.id}/${table.id}/views/${view.id}/${row['Id']}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
@ -1164,7 +1164,7 @@ function viewRowTests() {
const response = await request(context.app) const response = await request(context.app)
.patch( .patch(
`/api/v1/data/noco/${base.id}/${table.id}/views/${view.id}/${row['Id']}`, `/api/v1/db/data/noco/${base.id}/${table.id}/views/${view.id}/${row['Id']}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
@ -1202,7 +1202,7 @@ function viewRowTests() {
await request(context.app) await request(context.app)
.delete( .delete(
`/api/v1/data/noco/${base.id}/${table.id}/views/${view.id}/${row['Id']}`, `/api/v1/db/data/noco/${base.id}/${table.id}/views/${view.id}/${row['Id']}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -1256,7 +1256,7 @@ function viewRowTests() {
await request(context.app) await request(context.app)
.delete( .delete(
`/api/v1/data/noco/${base.id}/${table.id}/views/${view.id}/${row['Id']}`, `/api/v1/db/data/noco/${base.id}/${table.id}/views/${view.id}/${row['Id']}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -1289,7 +1289,7 @@ function viewRowTests() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/${row['CustomerId']}/exist`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/${row['CustomerId']}/exist`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -1312,7 +1312,7 @@ function viewRowTests() {
}); });
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/999999/exist`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/999999/exist`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -1335,7 +1335,7 @@ function viewRowTests() {
}); });
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.title}/views/${view.id}/export/csv`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.title}/views/${view.id}/export/csv`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -1359,7 +1359,7 @@ function viewRowTests() {
}); });
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.title}/views/${view.id}/export/excel`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.title}/views/${view.id}/export/excel`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);

2
tests/playwright/pages/Account/AppStore.ts

@ -13,7 +13,7 @@ export class AccountAppStorePage extends BasePage {
await this.waitForResponse({ await this.waitForResponse({
uiAction: () => this.rootPage.goto('/#/account/apps', { waitUntil: 'networkidle' }), uiAction: () => this.rootPage.goto('/#/account/apps', { waitUntil: 'networkidle' }),
httpMethodsToMatch: ['GET'], httpMethodsToMatch: ['GET'],
requestUrlPathToMatch: 'api/v1/meta/plugins', requestUrlPathToMatch: '/api/v1/db/meta/plugins',
}); });
} }

2
tests/playwright/pages/Account/ChangePassword.ts

@ -43,7 +43,7 @@ export class ChangePasswordPage extends BasePage {
await this.waitForResponse({ await this.waitForResponse({
uiAction: submitChangePassword, uiAction: submitChangePassword,
httpMethodsToMatch: ['POST'], httpMethodsToMatch: ['POST'],
requestUrlPathToMatch: 'api/v1/auth/password/change', requestUrlPathToMatch: 'api/v1/db/auth/password/change',
}); });
} else { } else {
await submitChangePassword(); await submitChangePassword();

2
tests/playwright/pages/Dashboard/BulkUpdate/index.ts

@ -181,7 +181,7 @@ export class BulkUpdatePage extends BasePage {
} else { } else {
await this.waitForResponse({ await this.waitForResponse({
uiAction: saveRowAction, uiAction: saveRowAction,
requestUrlPathToMatch: 'api/v1/data/noco/', requestUrlPathToMatch: 'api/v1/db/data/noco/',
httpMethodsToMatch: ['GET'], httpMethodsToMatch: ['GET'],
responseJsonMatcher: json => json['pageInfo'], responseJsonMatcher: json => json['pageInfo'],
}); });

4
tests/playwright/pages/Dashboard/ExpandedForm/index.ts

@ -113,14 +113,14 @@ export class ExpandedFormPage extends BasePage {
if (waitForRowsData) { if (waitForRowsData) {
await this.waitForResponse({ await this.waitForResponse({
uiAction: saveRowAction, uiAction: saveRowAction,
requestUrlPathToMatch: 'api/v1/data/noco/', requestUrlPathToMatch: 'api/v1/db/data/noco/',
httpMethodsToMatch: ['GET'], httpMethodsToMatch: ['GET'],
responseJsonMatcher: json => json['pageInfo'], responseJsonMatcher: json => json['pageInfo'],
}); });
} else { } else {
await this.waitForResponse({ await this.waitForResponse({
uiAction: saveRowAction, uiAction: saveRowAction,
requestUrlPathToMatch: 'api/v1/data/noco/', requestUrlPathToMatch: 'api/v1/db/data/noco/',
httpMethodsToMatch: ['POST'], httpMethodsToMatch: ['POST'],
}); });
} }

8
tests/playwright/pages/Dashboard/Form/index.ts

@ -164,7 +164,7 @@ export class FormPage extends BasePage {
await this.formHeading.fill(param.title); await this.formHeading.fill(param.title);
await this.formSubHeading.click(); await this.formSubHeading.click();
}, },
requestUrlPathToMatch: 'api/v1/meta/forms', requestUrlPathToMatch: '/api/v1/db/meta/forms',
httpMethodsToMatch: ['PATCH'], httpMethodsToMatch: ['PATCH'],
}); });
await this.waitForResponse({ await this.waitForResponse({
@ -173,7 +173,7 @@ export class FormPage extends BasePage {
await this.formSubHeading.fill(param.subtitle); await this.formSubHeading.fill(param.subtitle);
await this.formHeading.click(); await this.formHeading.click();
}, },
requestUrlPathToMatch: 'api/v1/meta/forms', requestUrlPathToMatch: '/api/v1/db/meta/forms',
httpMethodsToMatch: ['PATCH'], httpMethodsToMatch: ['PATCH'],
}); });
} }
@ -208,7 +208,7 @@ export class FormPage extends BasePage {
const waitForResponse = async (action: () => Promise<any>) => const waitForResponse = async (action: () => Promise<any>) =>
await this.waitForResponse({ await this.waitForResponse({
uiAction: action, uiAction: action,
requestUrlPathToMatch: 'api/v1/meta/form-columns', requestUrlPathToMatch: '/api/v1/db/meta/form-columns',
httpMethodsToMatch: ['PATCH'], httpMethodsToMatch: ['PATCH'],
}); });
@ -272,7 +272,7 @@ export class FormPage extends BasePage {
await this.afterSubmitMsg.click(); await this.afterSubmitMsg.click();
await this.afterSubmitMsg.fill(param.message); await this.afterSubmitMsg.fill(param.message);
}, },
requestUrlPathToMatch: 'api/v1/meta/forms', requestUrlPathToMatch: '/api/v1/db/meta/forms',
httpMethodsToMatch: ['PATCH'], httpMethodsToMatch: ['PATCH'],
}); });
} }

4
tests/playwright/pages/Dashboard/Grid/Column/index.ts

@ -337,7 +337,7 @@ export class ColumnPageObject extends BasePage {
await this.waitForResponse({ await this.waitForResponse({
uiAction: async () => await this.rootPage.locator('li[role="menuitem"]:has-text("Hide Field"):visible').click(), uiAction: async () => await this.rootPage.locator('li[role="menuitem"]:has-text("Hide Field"):visible').click(),
requestUrlPathToMatch: 'api/v1/meta/views', requestUrlPathToMatch: '/api/v1/db/meta/views',
httpMethodsToMatch: ['PATCH'], httpMethodsToMatch: ['PATCH'],
}); });
@ -347,7 +347,7 @@ export class ColumnPageObject extends BasePage {
async save({ isUpdated }: { isUpdated?: boolean } = {}) { async save({ isUpdated }: { isUpdated?: boolean } = {}) {
await this.waitForResponse({ await this.waitForResponse({
uiAction: async () => await this.get().locator('button:has-text("Save")').click(), uiAction: async () => await this.get().locator('button:has-text("Save")').click(),
requestUrlPathToMatch: 'api/v1/data/noco/', requestUrlPathToMatch: 'api/v1/db/data/noco/',
httpMethodsToMatch: ['GET'], httpMethodsToMatch: ['GET'],
responseJsonMatcher: json => json['pageInfo'], responseJsonMatcher: json => json['pageInfo'],
}); });

4
tests/playwright/pages/Dashboard/Grid/index.ts

@ -134,7 +134,7 @@ export class GridPage extends BasePage {
if (networkValidation) { if (networkValidation) {
await this.waitForResponse({ await this.waitForResponse({
uiAction: clickOnColumnHeaderToSave, uiAction: clickOnColumnHeaderToSave,
requestUrlPathToMatch: 'api/v1/data/noco', requestUrlPathToMatch: 'api/v1/db/data/noco',
httpMethodsToMatch: ['POST'], httpMethodsToMatch: ['POST'],
// numerical types are returned in number format from the server // numerical types are returned in number format from the server
responseJsonMatcher: resJson => String(resJson?.[columnHeader]) === String(rowValue), responseJsonMatcher: resJson => String(resJson?.[columnHeader]) === String(rowValue),
@ -166,7 +166,7 @@ export class GridPage extends BasePage {
if (networkValidation) { if (networkValidation) {
await this.waitForResponse({ await this.waitForResponse({
uiAction: clickOnColumnHeaderToSave, uiAction: clickOnColumnHeaderToSave,
requestUrlPathToMatch: 'api/v1/data/noco', requestUrlPathToMatch: 'api/v1/db/data/noco',
httpMethodsToMatch: [ httpMethodsToMatch: [
'PATCH', 'PATCH',
// since edit row on an empty row will emit POST request // since edit row on an empty row will emit POST request

2
tests/playwright/pages/Dashboard/Import/ImportTemplate.ts

@ -61,7 +61,7 @@ export class ImportTemplatePage extends BasePage {
await this.get().locator('button:has-text("Back"):visible').waitFor(); await this.get().locator('button:has-text("Back"):visible').waitFor();
await this.waitForResponse({ await this.waitForResponse({
requestUrlPathToMatch: '/api/v1/data/bulk/', requestUrlPathToMatch: '/api/v1/db/data/bulk/',
httpMethodsToMatch: ['POST'], httpMethodsToMatch: ['POST'],
uiAction: () => this.get().locator('button:has-text("Import"):visible').click(), uiAction: () => this.get().locator('button:has-text("Import"):visible').click(),
}); });

2
tests/playwright/pages/Dashboard/Settings/Miscellaneous.ts

@ -25,7 +25,7 @@ export class MiscSettingsPage extends BasePage {
async clickShowNullEmptyFilters() { async clickShowNullEmptyFilters() {
await this.waitForResponse({ await this.waitForResponse({
uiAction: () => this.get().locator('input[type="checkbox"]').last().click(), uiAction: () => this.get().locator('input[type="checkbox"]').last().click(),
requestUrlPathToMatch: 'api/v1/meta/bases', requestUrlPathToMatch: '/api/v1/db/meta/projects',
httpMethodsToMatch: ['PATCH'], httpMethodsToMatch: ['PATCH'],
}); });
} }

2
tests/playwright/pages/Dashboard/ShareProjectButton/index.ts

@ -108,7 +108,7 @@ export class ShareProjectButtonPage extends BasePage {
await this.waitForResponse({ await this.waitForResponse({
uiAction: () => this.rootPage.getByTestId('docs-base-share-public-toggle').click(), uiAction: () => this.rootPage.getByTestId('docs-base-share-public-toggle').click(),
httpMethodsToMatch: ['PATCH'], httpMethodsToMatch: ['PATCH'],
requestUrlPathToMatch: `/api/v1/meta/bases`, requestUrlPathToMatch: `/api/v1/db/meta/projects`,
}); });
} }

4
tests/playwright/pages/Dashboard/Sidebar/index.ts

@ -74,7 +74,7 @@ export class SidebarPage extends BasePage {
await this.waitForResponse({ await this.waitForResponse({
uiAction: () => this.dashboard.get().getByTestId('docs-create-proj-dlg-create-btn').click(), uiAction: () => this.dashboard.get().getByTestId('docs-create-proj-dlg-create-btn').click(),
httpMethodsToMatch: ['POST'], httpMethodsToMatch: ['POST'],
requestUrlPathToMatch: `api/v1/meta/bases/`, requestUrlPathToMatch: `/api/v1/db/meta/projects/`,
}); });
if (type === ProjectTypes.DOCUMENTATION) { if (type === ProjectTypes.DOCUMENTATION) {
@ -121,7 +121,7 @@ export class SidebarPage extends BasePage {
this.rootPage.locator('.ant-modal-content').locator('button.ant-btn.ant-btn-primary').click(); this.rootPage.locator('.ant-modal-content').locator('button.ant-btn.ant-btn-primary').click();
await this.waitForResponse({ await this.waitForResponse({
httpMethodsToMatch: ['POST'], httpMethodsToMatch: ['POST'],
requestUrlPathToMatch: '/api/v1/meta/tables/', requestUrlPathToMatch: '/api/v1/db/meta/tables/',
uiAction: submitAction, uiAction: submitAction,
responseJsonMatcher: json => json.title === title, responseJsonMatcher: json => json.title === title,
}); });

8
tests/playwright/pages/Dashboard/TreeView.ts

@ -109,7 +109,7 @@ export class TreeViewPage extends BasePage {
}, },
}), }),
httpMethodsToMatch: ['GET'], httpMethodsToMatch: ['GET'],
requestUrlPathToMatch: `/api/v1/data/noco/`, requestUrlPathToMatch: `/api/v1/db/data/noco`,
responseJsonMatcher: json => json.pageInfo, responseJsonMatcher: json => json.pageInfo,
}); });
await this.dashboard.waitForTabRender({ title, mode }); await this.dashboard.waitForTabRender({ title, mode });
@ -143,7 +143,7 @@ export class TreeViewPage extends BasePage {
await this.waitForResponse({ await this.waitForResponse({
uiAction: () => this.dashboard.get().locator('button:has-text("Create Table")').click(), uiAction: () => this.dashboard.get().locator('button:has-text("Create Table")').click(),
httpMethodsToMatch: ['POST'], httpMethodsToMatch: ['POST'],
requestUrlPathToMatch: `/api/v1/meta/bases/`, requestUrlPathToMatch: `/api/v1/db/meta/projects/`,
responseJsonMatcher: json => json.title === title && json.type === 'table', responseJsonMatcher: json => json.title === title && json.type === 'table',
}); });
@ -179,7 +179,7 @@ export class TreeViewPage extends BasePage {
return await this.dashboard.get().locator('button:has-text("Delete Table")').click(); return await this.dashboard.get().locator('button:has-text("Delete Table")').click();
}, },
httpMethodsToMatch: ['DELETE'], httpMethodsToMatch: ['DELETE'],
requestUrlPathToMatch: `/api/v1/meta/tables/`, requestUrlPathToMatch: `/api/v1/db/meta/tables/`,
}); });
await (await this.rootPage.locator('.nc-container').last().elementHandle())?.waitForElementState('stable'); await (await this.rootPage.locator('.nc-container').last().elementHandle())?.waitForElementState('stable');
@ -253,7 +253,7 @@ export class TreeViewPage extends BasePage {
await this.waitForResponse({ await this.waitForResponse({
uiAction: async () => await this.rootPage.getByRole('button', { name: 'Confirm' }).click(), uiAction: async () => await this.rootPage.getByRole('button', { name: 'Confirm' }).click(),
httpMethodsToMatch: ['POST'], httpMethodsToMatch: ['POST'],
requestUrlPathToMatch: `/api/v1/meta/duplicate/`, requestUrlPathToMatch: `/api/v1/db/meta/duplicate/`,
}); });
await this.get().locator(`[data-testid="nc-tbl-title-${title} copy"]`).waitFor(); await this.get().locator(`[data-testid="nc-tbl-title-${title} copy"]`).waitFor();
} }

2
tests/playwright/pages/Dashboard/ViewSidebar/index.ts

@ -163,7 +163,7 @@ export class ViewSidebarPage extends BasePage {
this.rootPage.locator('.ant-modal-content').locator('button:has-text("Create a View"):visible').click(); this.rootPage.locator('.ant-modal-content').locator('button:has-text("Create a View"):visible').click();
await this.waitForResponse({ await this.waitForResponse({
httpMethodsToMatch: ['POST'], httpMethodsToMatch: ['POST'],
requestUrlPathToMatch: '/api/v1/meta/tables/', requestUrlPathToMatch: '/api/v1/db/meta/tables/',
uiAction: submitAction, uiAction: submitAction,
}); });
// await this.verifyToast({ message: 'View created successfully' }); // await this.verifyToast({ message: 'View created successfully' });

2
tests/playwright/pages/Dashboard/common/Cell/RatingCell.ts

@ -19,7 +19,7 @@ export class RatingCellPageObject extends BasePage {
await this.waitForResponse({ await this.waitForResponse({
uiAction: async () => await this.get({ index, columnHeader }).locator('.ant-rate-star > div').nth(rating).click(), uiAction: async () => await this.get({ index, columnHeader }).locator('.ant-rate-star > div').nth(rating).click(),
httpMethodsToMatch: ['POST', 'PATCH'], httpMethodsToMatch: ['POST', 'PATCH'],
requestUrlPathToMatch: 'api/v1/data/noco/', requestUrlPathToMatch: 'api/v1/db/data/noco/',
}); });
} }

2
tests/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts

@ -159,7 +159,7 @@ export class SelectOptionCellPageObject extends BasePage {
const saveRowAction = () => selectCell.locator('.ant-select-selection-search-input').press('Enter'); const saveRowAction = () => selectCell.locator('.ant-select-selection-search-input').press('Enter');
await this.waitForResponse({ await this.waitForResponse({
uiAction: saveRowAction, uiAction: saveRowAction,
requestUrlPathToMatch: 'api/v1/data/noco/', requestUrlPathToMatch: 'api/v1/db/data/noco/',
httpMethodsToMatch: ['PATCH'], httpMethodsToMatch: ['PATCH'],
responseJsonMatcher: resJson => String(resJson?.[columnHeader]).includes(String(option)), responseJsonMatcher: resJson => String(resJson?.[columnHeader]).includes(String(option)),
}); });

4
tests/playwright/pages/Dashboard/common/Cell/index.ts

@ -90,7 +90,7 @@ export class CellPageObject extends BasePage {
// await this.get({ index, columnHeader }).hover(); // await this.get({ index, columnHeader }).hover();
await this.waitForResponse({ await this.waitForResponse({
uiAction: () => this.get({ index, columnHeader }).locator('.nc-datatype-link').click(), uiAction: () => this.get({ index, columnHeader }).locator('.nc-datatype-link').click(),
requestUrlPathToMatch: '/api/v1/data/noco/', requestUrlPathToMatch: '/api/v1/db/data/noco',
httpMethodsToMatch: ['GET'], httpMethodsToMatch: ['GET'],
}); });
} }
@ -371,7 +371,7 @@ export class CellPageObject extends BasePage {
await this.waitForResponse({ await this.waitForResponse({
uiAction: () => uiAction: () =>
this.rootPage.locator(`[data-testid="nc-child-list-item"]`).last().click({ force: true, timeout: 3000 }), this.rootPage.locator(`[data-testid="nc-child-list-item"]`).last().click({ force: true, timeout: 3000 }),
requestUrlPathToMatch: '/api/v1/data/noco/', requestUrlPathToMatch: '/api/v1/db/data/noco',
httpMethodsToMatch: ['GET'], httpMethodsToMatch: ['GET'],
}); });

10
tests/playwright/pages/Dashboard/common/Toolbar/Fields.ts

@ -35,7 +35,7 @@ export class ToolbarFieldsPage extends BasePage {
if (validateResponse) { if (validateResponse) {
await this.waitForResponse({ await this.waitForResponse({
uiAction: toggleColumn, uiAction: toggleColumn,
requestUrlPathToMatch: isLocallySaved ? '/api/v1/public/' : '/api/v1/data/noco/', requestUrlPathToMatch: isLocallySaved ? '/api/v1/db/public/' : '/api/v1/db/data/noco/',
httpMethodsToMatch: ['GET'], httpMethodsToMatch: ['GET'],
}); });
} else { } else {
@ -59,7 +59,7 @@ export class ToolbarFieldsPage extends BasePage {
async click({ title, isLocallySaved }: { title: string; isLocallySaved?: boolean }) { async click({ title, isLocallySaved }: { title: string; isLocallySaved?: boolean }) {
await this.waitForResponse({ await this.waitForResponse({
uiAction: () => this.get().locator(`[data-testid="nc-fields-menu-${title}"]`).locator('.nc-switch').click(), uiAction: () => this.get().locator(`[data-testid="nc-fields-menu-${title}"]`).locator('.nc-switch').click(),
requestUrlPathToMatch: isLocallySaved ? '/api/v1/public/' : '/api/v1/data/noco/', requestUrlPathToMatch: isLocallySaved ? '/api/v1/db/public/' : '/api/v1/db/data/noco/',
httpMethodsToMatch: ['GET'], httpMethodsToMatch: ['GET'],
}); });
await this.toolbar.parent.waitLoading(); await this.toolbar.parent.waitLoading();
@ -69,7 +69,7 @@ export class ToolbarFieldsPage extends BasePage {
await this.toolbar.clickFields(); await this.toolbar.clickFields();
await this.waitForResponse({ await this.waitForResponse({
uiAction: () => this.get().locator(`.nc-fields-show-all-fields`).click(), uiAction: () => this.get().locator(`.nc-fields-show-all-fields`).click(),
requestUrlPathToMatch: isLocallySaved ? '/api/v1/public/' : '/api/v1/data/noco/', requestUrlPathToMatch: isLocallySaved ? '/api/v1/db/public/' : '/api/v1/db/data/noco/',
httpMethodsToMatch: ['GET'], httpMethodsToMatch: ['GET'],
timeout: 10000, timeout: 10000,
}); });
@ -80,7 +80,7 @@ export class ToolbarFieldsPage extends BasePage {
// await this.toolbar.clickFields(); // await this.toolbar.clickFields();
// await this.waitForResponse({ // await this.waitForResponse({
// uiAction: () => this.get().locator(`button.nc-switch`).first().click(), // uiAction: () => this.get().locator(`button.nc-switch`).first().click(),
// requestUrlPathToMatch: isLocallySaved ? '/api/v1/public/' : '/api/v1/data/noco/', // requestUrlPathToMatch: isLocallySaved ? '/api/v1/db/public/' : '/api/v1/db/data/noco/',
// httpMethodsToMatch: ['GET'], // httpMethodsToMatch: ['GET'],
// }); // });
// await this.toolbar.clickFields(); // await this.toolbar.clickFields();
@ -90,7 +90,7 @@ export class ToolbarFieldsPage extends BasePage {
await this.toolbar.clickFields(); await this.toolbar.clickFields();
await this.waitForResponse({ await this.waitForResponse({
uiAction: async () => await this.get().locator(`.nc-fields-show-system-fields`).click(), uiAction: async () => await this.get().locator(`.nc-fields-show-system-fields`).click(),
requestUrlPathToMatch: isLocallySaved ? '/api/v1/public/' : '/api/v1/data/noco/', requestUrlPathToMatch: isLocallySaved ? '/api/v1/db/public/' : '/api/v1/db/data/noco/',
httpMethodsToMatch: ['GET'], httpMethodsToMatch: ['GET'],
}); });
await this.toolbar.clickFields(); await this.toolbar.clickFields();

18
tests/playwright/pages/Dashboard/common/Toolbar/Filter.ts

@ -151,7 +151,7 @@ export class ToolbarFilterPage extends BasePage {
.locator(`div[label="${title}"]:visible`) .locator(`div[label="${title}"]:visible`)
.click(), .click(),
httpMethodsToMatch: ['GET'], httpMethodsToMatch: ['GET'],
requestUrlPathToMatch: locallySaved ? `/api/v1/public/` : `/api/v1/data/noco/`, requestUrlPathToMatch: locallySaved ? `/api/v1/db/public/` : `/api/v1/db/data/noco/`,
}); });
} }
} }
@ -178,7 +178,7 @@ export class ToolbarFilterPage extends BasePage {
.first() .first()
.click(), .click(),
httpMethodsToMatch: ['GET'], httpMethodsToMatch: ['GET'],
requestUrlPathToMatch: locallySaved ? `/api/v1/public/` : `/api/v1/data/noco/`, requestUrlPathToMatch: locallySaved ? `/api/v1/db/public/` : `/api/v1/db/data/noco/`,
}); });
} }
} }
@ -206,7 +206,7 @@ export class ToolbarFilterPage extends BasePage {
.first() .first()
.click(), .click(),
httpMethodsToMatch: ['GET'], httpMethodsToMatch: ['GET'],
requestUrlPathToMatch: locallySaved ? `/api/v1/public/` : `/api/v1/data/noco/`, requestUrlPathToMatch: locallySaved ? `/api/v1/db/public/` : `/api/v1/db/data/noco/`,
}); });
} }
} }
@ -249,7 +249,7 @@ export class ToolbarFilterPage extends BasePage {
uiAction: async () => uiAction: async () =>
await this.rootPage.locator(`.ant-picker-cell-inner:has-text("${value}")`).click(), await this.rootPage.locator(`.ant-picker-cell-inner:has-text("${value}")`).click(),
httpMethodsToMatch: ['GET'], httpMethodsToMatch: ['GET'],
requestUrlPathToMatch: locallySaved ? `/api/v1/public/` : `/api/v1/data/noco/`, requestUrlPathToMatch: locallySaved ? `/api/v1/db/public/` : `/api/v1/db/data/noco/`,
}); });
} }
} else { } else {
@ -261,7 +261,7 @@ export class ToolbarFilterPage extends BasePage {
await this.waitForResponse({ await this.waitForResponse({
uiAction: fillFilter, uiAction: fillFilter,
httpMethodsToMatch: ['GET'], httpMethodsToMatch: ['GET'],
requestUrlPathToMatch: locallySaved ? `/api/v1/public/` : `/api/v1/data/noco/`, requestUrlPathToMatch: locallySaved ? `/api/v1/db/public/` : `/api/v1/db/data/noco/`,
}); });
} }
await this.toolbar.parent.dashboard.waitForLoaderToDisappear(); await this.toolbar.parent.dashboard.waitForLoaderToDisappear();
@ -277,7 +277,7 @@ export class ToolbarFilterPage extends BasePage {
await this.waitForResponse({ await this.waitForResponse({
uiAction: async () => await this.get().locator('.nc-filter-value-select').locator('input').fill(value), uiAction: async () => await this.get().locator('.nc-filter-value-select').locator('input').fill(value),
httpMethodsToMatch: ['GET'], httpMethodsToMatch: ['GET'],
requestUrlPathToMatch: locallySaved ? `/api/v1/public/` : `/api/v1/data/noco/`, requestUrlPathToMatch: locallySaved ? `/api/v1/db/public/` : `/api/v1/db/data/noco/`,
}); });
} }
break; break;
@ -336,7 +336,7 @@ export class ToolbarFilterPage extends BasePage {
await this.waitForResponse({ await this.waitForResponse({
uiAction: fillFilter, uiAction: fillFilter,
httpMethodsToMatch: ['GET'], httpMethodsToMatch: ['GET'],
requestUrlPathToMatch: locallySaved ? `/api/v1/public/` : `/api/v1/data/noco/`, requestUrlPathToMatch: locallySaved ? `/api/v1/db/public/` : `/api/v1/db/data/noco/`,
}); });
await this.toolbar.parent.dashboard.waitForLoaderToDisappear(); await this.toolbar.parent.dashboard.waitForLoaderToDisappear();
await this.toolbar.parent.waitLoading(); await this.toolbar.parent.waitLoading();
@ -351,7 +351,7 @@ export class ToolbarFilterPage extends BasePage {
await this.waitForResponse({ await this.waitForResponse({
uiAction: async () => await this.get().locator('.nc-filter-item-remove-btn').click(), uiAction: async () => await this.get().locator('.nc-filter-item-remove-btn').click(),
httpMethodsToMatch: ['DELETE'], httpMethodsToMatch: ['DELETE'],
requestUrlPathToMatch: '/api/v1/meta/filters/', requestUrlPathToMatch: '/api/v1/db/meta/filters/',
}); });
} else { } else {
await this.get().locator('.nc-filter-item-remove-btn').click(); await this.get().locator('.nc-filter-item-remove-btn').click();
@ -367,7 +367,7 @@ export class ToolbarFilterPage extends BasePage {
await this.waitForResponse({ await this.waitForResponse({
uiAction: async () => await this.get().locator('.nc-filter-item-remove-btn').click(), uiAction: async () => await this.get().locator('.nc-filter-item-remove-btn').click(),
httpMethodsToMatch: ['DELETE'], httpMethodsToMatch: ['DELETE'],
requestUrlPathToMatch: '/api/v1/meta/filters/', requestUrlPathToMatch: '/api/v1/db/meta/filters/',
}); });
} else { } else {
await this.get().locator('.nc-filter-item-remove-btn').click(); await this.get().locator('.nc-filter-item-remove-btn').click();

2
tests/playwright/pages/Dashboard/common/Toolbar/Groupby.ts

@ -77,7 +77,7 @@ export class ToolbarGroupByPage extends BasePage {
await this.waitForResponse({ await this.waitForResponse({
uiAction: selectSortDirection, uiAction: selectSortDirection,
httpMethodsToMatch: ['GET'], httpMethodsToMatch: ['GET'],
requestUrlPathToMatch: locallySaved ? `/api/v1/public/` : `/api/v1/data/noco/`, requestUrlPathToMatch: locallySaved ? `/api/v1/db/public/` : `/api/v1/db/data/noco/`,
}); });
} }

6
tests/playwright/pages/Dashboard/common/Toolbar/Sort.ts

@ -68,7 +68,7 @@ export class ToolbarSortPage extends BasePage {
await this.waitForResponse({ await this.waitForResponse({
uiAction: selectSortDirection, uiAction: selectSortDirection,
httpMethodsToMatch: ['GET'], httpMethodsToMatch: ['GET'],
requestUrlPathToMatch: locallySaved ? `/api/v1/public/` : `/api/v1/data/noco/`, requestUrlPathToMatch: locallySaved ? `/api/v1/db/public/` : `/api/v1/db/data/noco/`,
}); });
await this.toolbar.parent.dashboard.waitForLoaderToDisappear(); await this.toolbar.parent.dashboard.waitForLoaderToDisappear();
// close sort menu // close sort menu
@ -119,7 +119,7 @@ export class ToolbarSortPage extends BasePage {
await this.waitForResponse({ await this.waitForResponse({
uiAction: selectColumn, uiAction: selectColumn,
httpMethodsToMatch: ['GET'], httpMethodsToMatch: ['GET'],
requestUrlPathToMatch: locallySaved ? `/api/v1/public/` : `/api/v1/data/noco/`, requestUrlPathToMatch: locallySaved ? `/api/v1/db/public/` : `/api/v1/db/data/noco/`,
}); });
// read content of the dropdown // read content of the dropdown
@ -159,7 +159,7 @@ export class ToolbarSortPage extends BasePage {
await this.waitForResponse({ await this.waitForResponse({
uiAction: selectSortDirection, uiAction: selectSortDirection,
httpMethodsToMatch: ['GET'], httpMethodsToMatch: ['GET'],
requestUrlPathToMatch: locallySaved ? `/api/v1/public/` : `/api/v1/data/noco/`, requestUrlPathToMatch: locallySaved ? `/api/v1/db/public/` : `/api/v1/db/data/noco/`,
}); });
await this.toolbar.parent.dashboard.waitForLoaderToDisappear(); await this.toolbar.parent.dashboard.waitForLoaderToDisappear();
// close sort menu // close sort menu

12
tests/playwright/pages/ProjectsPage/index.ts

@ -41,7 +41,7 @@ export class ProjectsPage extends BasePage {
await this.waitForResponse({ await this.waitForResponse({
uiAction: createProjectSubmitAction, uiAction: createProjectSubmitAction,
httpMethodsToMatch: ['POST'], httpMethodsToMatch: ['POST'],
requestUrlPathToMatch: '/api/v1/meta/bases/', requestUrlPathToMatch: '/api/v1/db/meta/projects/',
}); });
// wait for dashboard to render // wait for dashboard to render
@ -89,7 +89,7 @@ export class ProjectsPage extends BasePage {
await this.waitForResponse({ await this.waitForResponse({
uiAction: dupeProjectSubmitAction, uiAction: dupeProjectSubmitAction,
httpMethodsToMatch: ['POST'], httpMethodsToMatch: ['POST'],
requestUrlPathToMatch: 'api/v1/meta/duplicate/', requestUrlPathToMatch: '/api/v1/db/meta/duplicate/',
}); });
// wait for duplicate create completed and render kebab // wait for duplicate create completed and render kebab
await this.get().locator(`[data-testid="p-three-dot-${name} copy"]`).waitFor(); await this.get().locator(`[data-testid="p-three-dot-${name} copy"]`).waitFor();
@ -103,7 +103,7 @@ export class ProjectsPage extends BasePage {
const reloadUiAction = () => this.get().locator('[data-testid="bases-reload-button"]').click(); const reloadUiAction = () => this.get().locator('[data-testid="bases-reload-button"]').click();
await this.waitForResponse({ await this.waitForResponse({
uiAction: reloadUiAction, uiAction: reloadUiAction,
requestUrlPathToMatch: '/api/v1/meta/bases', requestUrlPathToMatch: '/api/v1/db/meta/projects',
httpMethodsToMatch: ['GET'], httpMethodsToMatch: ['GET'],
}); });
} }
@ -145,7 +145,7 @@ export class ProjectsPage extends BasePage {
} }
const isRequiredResponse = const isRequiredResponse =
res.request().url().includes('/api/v1/meta/bases') && res.request().url().includes('/api/v1/db/meta/projects') &&
['GET'].includes(res.request().method()) && ['GET'].includes(res.request().method()) &&
json?.title === title; json?.title === title;
@ -180,7 +180,7 @@ export class ProjectsPage extends BasePage {
await this.waitForResponse({ await this.waitForResponse({
uiAction: deleteProjectAction, uiAction: deleteProjectAction,
httpMethodsToMatch: ['DELETE'], httpMethodsToMatch: ['DELETE'],
requestUrlPathToMatch: '/api/v1/meta/bases/', requestUrlPathToMatch: '/api/v1/db/meta/projects/',
}); });
await this.get().locator('.ant-table-row', { hasText: title }).waitFor({ state: 'hidden' }); await this.get().locator('.ant-table-row', { hasText: title }).waitFor({ state: 'hidden' });
@ -212,7 +212,7 @@ export class ProjectsPage extends BasePage {
const submitAction = () => base.locator('input.nc-metadb-base-name').press('Enter'); const submitAction = () => base.locator('input.nc-metadb-base-name').press('Enter');
await this.waitForResponse({ await this.waitForResponse({
uiAction: submitAction, uiAction: submitAction,
requestUrlPathToMatch: 'api/v1/meta/bases/', requestUrlPathToMatch: '/api/v1/db/meta/projects/',
httpMethodsToMatch: ['PATCH'], httpMethodsToMatch: ['PATCH'],
}); });
} }

6
tests/playwright/pages/WorkspacePage/ContainerPage.ts

@ -140,7 +140,7 @@ export class ContainerPage extends BasePage {
await this.waitForResponse({ await this.waitForResponse({
uiAction: () => this.rootPage.locator('.nc-metadb-base-name').press('Enter'), uiAction: () => this.rootPage.locator('.nc-metadb-base-name').press('Enter'),
httpMethodsToMatch: ['POST'], httpMethodsToMatch: ['POST'],
requestUrlPathToMatch: `api/v1/meta/bases`, requestUrlPathToMatch: `/api/v1/db/meta/projects`,
}); });
} }
@ -154,7 +154,7 @@ export class ContainerPage extends BasePage {
await this.waitForResponse({ await this.waitForResponse({
uiAction: () => row.locator('td.ant-table-cell').nth(0).locator('input').press('Enter'), uiAction: () => row.locator('td.ant-table-cell').nth(0).locator('input').press('Enter'),
httpMethodsToMatch: ['PATCH'], httpMethodsToMatch: ['PATCH'],
requestUrlPathToMatch: `api/v1/meta/bases/`, requestUrlPathToMatch: `/api/v1/db/meta/projects/`,
}); });
} }
@ -185,7 +185,7 @@ export class ContainerPage extends BasePage {
await this.waitForResponse({ await this.waitForResponse({
uiAction: () => this.rootPage.locator('.ant-modal-content').locator('button:has-text("Delete")').click(), uiAction: () => this.rootPage.locator('.ant-modal-content').locator('button:has-text("Delete")').click(),
httpMethodsToMatch: ['DELETE'], httpMethodsToMatch: ['DELETE'],
requestUrlPathToMatch: `api/v1/meta/bases/`, requestUrlPathToMatch: `/api/v1/db/meta/projects/`,
}); });
} }

2
tests/playwright/tests/db/features/swagger.spec.ts

@ -17,7 +17,7 @@ test.describe('Swagger', () => {
test('Create column', async () => { test('Create column', async () => {
// access swagger link // access swagger link
const link = `http://localhost:8080/api/v1/meta/bases/${context.base.id}/swagger`; const link = `http://localhost:8080/api/v1/db/meta/projects/${context.base.id}/swagger`;
await dashboard.rootPage.goto(link); await dashboard.rootPage.goto(link);
const swagger = dashboard.rootPage; const swagger = dashboard.rootPage;

4
tests/playwright/tests/db/features/undo-redo.spec.ts

@ -32,7 +32,7 @@ async function undo({ page, dashboard }: { page: Page; dashboard: DashboardPage
await dashboard.grid.waitForResponse({ await dashboard.grid.waitForResponse({
uiAction: async () => await page.keyboard.press(isMac ? 'Meta+z' : 'Control+z'), uiAction: async () => await page.keyboard.press(isMac ? 'Meta+z' : 'Control+z'),
httpMethodsToMatch: ['GET'], httpMethodsToMatch: ['GET'],
requestUrlPathToMatch: `/api/v1/data/noco/`, requestUrlPathToMatch: `/api/v1/db/data/noco`,
responseJsonMatcher: json => json.pageInfo, responseJsonMatcher: json => json.pageInfo,
}); });
} else { } else {
@ -593,7 +593,7 @@ test.describe('Undo Redo - LTAR', () => {
await dashboard.grid.waitForResponse({ await dashboard.grid.waitForResponse({
uiAction: async () => await page.keyboard.press(isMac ? 'Meta+z' : 'Control+z'), uiAction: async () => await page.keyboard.press(isMac ? 'Meta+z' : 'Control+z'),
httpMethodsToMatch: ['GET'], httpMethodsToMatch: ['GET'],
requestUrlPathToMatch: `/api/v1/data/noco/`, requestUrlPathToMatch: `/api/v1/db/data/noco`,
responseJsonMatcher: json => json.pageInfo, responseJsonMatcher: json => json.pageInfo,
}); });
await verifyRecords(values); await verifyRecords(values);

2
tests/playwright/tests/db/general/groupCRUD.spec.ts

@ -15,7 +15,7 @@ async function undo({ page, dashboard }: { page: Page; dashboard: DashboardPage
await dashboard.grid.waitForResponse({ await dashboard.grid.waitForResponse({
uiAction: () => page.keyboard.press(isMac ? 'Meta+z' : 'Control+z'), uiAction: () => page.keyboard.press(isMac ? 'Meta+z' : 'Control+z'),
httpMethodsToMatch: ['GET'], httpMethodsToMatch: ['GET'],
requestUrlPathToMatch: `/api/v1/data/noco/`, requestUrlPathToMatch: `/api/v1/db/data/noco/`,
responseJsonMatcher: json => json.pageInfo, responseJsonMatcher: json => json.pageInfo,
}); });
} else { } else {

Loading…
Cancel
Save