Browse Source

Merge branch 'develop' into docs/v2

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

12
.github/workflows/publish-api-docs.yml

@ -53,3 +53,15 @@ jobs:
user_email: 'oof1lab@gmail.com'
user_name: 'o1lab'
commit_message: 'Autorelease from github.com/nocodb/nocodb'
- name: Pushes swagger file to meta-apis-v2
uses: dmnemec/copy_file_to_another_repo_action@1b29cbd9a323185f20b175dc6d5f8f31be5c0658
env:
API_TOKEN_GITHUB: ${{ secrets.GH_TOKEN }}
with:
source_file: 'packages/nocodb/src/schema/swagger-v2.json'
destination_repo: 'nocodb/noco-apis-doc'
destination_folder: 'meta-apis-v2'
user_email: 'oof1lab@gmail.com'
user_name: 'o1lab'
commit_message: 'Autorelease from github.com/nocodb/nocodb'

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

@ -57,7 +57,7 @@ const basesStore = useBases()
const { isMobileMode } = useGlobal()
const { loadProjects, createProject: _createProject, updateProject, getProjectMetaInfo } = basesStore
const { createProject: _createProject, updateProject, getProjectMetaInfo } = basesStore
const { bases } = storeToRefs(basesStore)
@ -65,7 +65,7 @@ const { loadProjectTables } = useTablesStore()
const { activeTable } = storeToRefs(useTablesStore())
const { appInfo, navigateToProject } = useGlobal()
const { appInfo } = useGlobal()
const { orgRoles, isUIAllowed } = useRoles()
@ -351,46 +351,6 @@ const duplicateProject = (base: BaseType) => {
selectedProjectToDuplicate.value = base
isDuplicateDlgOpen.value = true
}
const { $poller } = useNuxtApp()
const DlgProjectDuplicateOnOk = async (jobData: { id: string; base_id: string }) => {
await loadProjects('workspace')
$poller.subscribe(
{ id: jobData.id },
async (data: {
id: string
status?: string
data?: {
error?: {
message: string
}
message?: string
result?: any
}
}) => {
if (data.status !== 'close') {
if (data.status === JobStatus.COMPLETED) {
await loadProjects('workspace')
const base = bases.value.get(jobData.base_id)
// open base after duplication
if (base) {
await navigateToProject({
baseId: base.id,
type: base.type,
})
}
} else if (data.status === JobStatus.FAILED) {
message.error('Failed to duplicate base')
await loadProjects('workspace')
}
}
},
)
$e('a:base:duplicate')
}
const tableDelete = () => {
isTableDeleteDialogVisible.value = true
@ -554,7 +514,7 @@ const projectDelete = () => {
@click.stop="
() => {
$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)
}
"
>
@ -791,12 +751,7 @@ const projectDelete = () => {
:base-id="base?.id"
/>
<DlgProjectDelete v-model:visible="isProjectDeleteDialogVisible" :base-id="base?.id" />
<DlgProjectDuplicate
v-if="selectedProjectToDuplicate"
v-model="isDuplicateDlgOpen"
:base="selectedProjectToDuplicate"
:on-ok="DlgProjectDuplicateOnOk"
/>
<DlgProjectDuplicate v-if="selectedProjectToDuplicate" v-model="isDuplicateDlgOpen" :base="selectedProjectToDuplicate" />
<GeneralModal v-model:visible="isErdModalOpen" size="large">
<div class="h-[80vh]">
<LazyDashboardSettingsErd :source-id="activeBaseId" />

50
packages/nc-gui/components/dashboard/TreeView/index.vue

@ -1,11 +1,8 @@
<script setup lang="ts">
import type { TableType } from 'nocodb-sdk'
import { message } from 'ant-design-vue'
import ProjectWrapper from './ProjectWrapper.vue'
import type { TabType } from '#imports'
import {
TreeViewInj,
computed,
@ -22,16 +19,13 @@ import {
useNuxtApp,
useRoles,
useTablesStore,
useTabs,
} from '#imports'
import { useRouter } from '#app'
const { isUIAllowed } = useRoles()
const { addTab } = useTabs()
const { $e, $poller } = useNuxtApp()
const { $e } = useNuxtApp()
const router = useRouter()
@ -45,22 +39,14 @@ const { bases, basesList, activeProjectId } = storeToRefs(basesStore)
const { isWorkspaceLoading } = storeToRefs(useWorkspace())
const { openTable } = useTablesStore()
const baseCreateDlg = ref(false)
const baseStore = useBase()
const { loadTables } = baseStore
const { tables, isSharedBase } = storeToRefs(baseStore)
const { t } = useI18n()
const { isSharedBase } = storeToRefs(baseStore)
const { activeTable: _activeTable } = storeToRefs(useTablesStore())
const { refreshCommandPalette } = useCommandPalette()
const contextMenuTarget = reactive<{ type?: 'base' | 'source' | 'table' | 'main' | 'layout'; value?: any }>({})
const setMenuContext = (type: 'base' | 'source' | 'table' | 'main' | 'layout', value?: any) => {
@ -120,38 +106,6 @@ const duplicateTable = async (table: TableType) => {
const { close } = useDialog(resolveComponent('DlgTableDuplicate'), {
'modelValue': isOpen,
'table': table,
'onOk': async (jobData: { id: string }) => {
$poller.subscribe(
{ id: jobData.id },
async (data: {
id: string
status?: string
data?: {
error?: {
message: string
}
message?: string
result?: any
}
}) => {
if (data.status !== 'close') {
if (data.status === JobStatus.COMPLETED) {
await loadTables()
refreshCommandPalette()
const newTable = tables.value.find((el) => el.id === data?.data?.result?.id)
if (newTable) addTab({ title: newTable.title, id: newTable.id, type: newTable.type as TabType })
openTable(newTable!)
} else if (data.status === JobStatus.FAILED) {
message.error(t('msg.error.failedToDuplicateTable'))
await loadTables()
}
}
},
)
$e('a:table:duplicate')
},
'onUpdate:modelValue': closeDialog,
})

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

@ -125,14 +125,14 @@ async function createOrUpdate() {
const { id, ...payload } = syncSource.value
if (id !== '') {
await $fetch(`/api/v1/meta/syncs/${id}`, {
await $fetch(`/api/v1/db/meta/syncs/${id}`, {
baseURL,
method: 'PATCH',
headers: { 'xc-auth': $state.token.value as string },
body: payload,
})
} 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,
method: 'POST',
headers: { 'xc-auth': $state.token.value as string },
@ -184,7 +184,7 @@ async function listenForUpdates() {
}
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,
method: 'GET',
headers: { 'xc-auth': $state.token.value as string },
@ -226,7 +226,7 @@ async function loadSyncSrc() {
async function sync() {
try {
await $fetch(`/api/v1/meta/syncs/${syncSource.value.id}/trigger`, {
await $fetch(`/api/v1/db/meta/syncs/${syncSource.value.id}/trigger`, {
baseURL,
method: 'POST',
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.",
onOk: async () => {
try {
await $fetch(`/api/v1/meta/syncs/${syncSource.value.id}/abort`, {
await $fetch(`/api/v1/db/meta/syncs/${syncSource.value.id}/abort`, {
baseURL,
method: 'POST',
headers: { 'xc-auth': $state.token.value as string },

77
packages/nc-gui/components/dlg/ProjectDuplicate.vue

@ -1,12 +1,11 @@
<script setup lang="ts">
import tinycolor from 'tinycolor2'
import type { BaseType } from 'nocodb-sdk'
import { useVModel } from '#imports'
import { isEeUI, useVModel } from '#imports'
const props = defineProps<{
modelValue: boolean
base: BaseType
onOk: (jobData: { name: string; id: string }) => Promise<void>
}>()
const emit = defineEmits(['update:modelValue'])
@ -15,6 +14,15 @@ const { refreshCommandPalette } = useCommandPalette()
const { api } = useApi()
const { $e, $poller } = useNuxtApp()
const basesStore = useBases()
const { loadProjects, createProject: _createProject } = basesStore
const { bases } = storeToRefs(basesStore)
const { navigateToProject } = useGlobal()
const dialogShow = useVModel(props, 'modelValue', emit)
const options = ref({
@ -57,12 +65,51 @@ const _duplicate = async () => {
}),
},
})
props.onOk(jobData as any)
$poller.subscribe(
{ id: jobData.id },
async (data: {
id: string
status?: string
data?: {
error?: {
message: string
}
message?: string
result?: any
}
}) => {
if (data.status !== 'close') {
if (data.status === JobStatus.COMPLETED) {
await loadProjects('workspace')
const base = bases.value.get(jobData.base_id)
// open project after duplication
if (base) {
await navigateToProject({
workspaceId: isEeUI ? base.fk_workspace_id : undefined,
baseId: base.id,
type: base.type,
})
}
refreshCommandPalette()
isLoading.value = false
dialogShow.value = false
} else if (data.status === JobStatus.FAILED) {
message.error('Failed to duplicate project')
await loadProjects('workspace')
refreshCommandPalette()
isLoading.value = false
dialogShow.value = false
}
}
},
)
$e('a:base:duplicate')
} catch (e: any) {
message.error(await extractSdkResponseErrorMsg(e))
} finally {
isLoading.value = false
refreshCommandPalette()
dialogShow.value = false
}
}
@ -78,7 +125,15 @@ const isEaster = ref(false)
</script>
<template>
<GeneralModal v-if="base" v-model:visible="dialogShow" class="!w-[30rem]" wrap-class-name="nc-modal-base-duplicate">
<GeneralModal
v-if="base"
v-model:visible="dialogShow"
:closable="!isLoading"
:mask-closable="!isLoading"
:keyboard="!isLoading"
class="!w-[30rem]"
wrap-class-name="nc-modal-base-duplicate"
>
<div>
<div class="prose-xl font-bold self-center" @dblclick="isEaster = !isEaster">
{{ $t('general.duplicate') }} {{ $t('objects.project') }}
@ -91,13 +146,15 @@ const isEaster = ref(false)
<a-divider class="!m-0 !p-0 !my-2" />
<div class="text-xs p-2">
<a-checkbox v-model:checked="options.includeData">{{ $t('labels.includeData') }}</a-checkbox>
<a-checkbox v-model:checked="options.includeViews">{{ $t('labels.includeView') }}</a-checkbox>
<a-checkbox v-show="isEaster" v-model:checked="options.includeHooks">{{ $t('labels.includeWebhook') }}</a-checkbox>
<a-checkbox v-model:checked="options.includeData" :disabled="isLoading">{{ $t('labels.includeData') }}</a-checkbox>
<a-checkbox v-model:checked="options.includeViews" :disabled="isLoading">{{ $t('labels.includeView') }}</a-checkbox>
<a-checkbox v-show="isEaster" v-model:checked="options.includeHooks" :disabled="isLoading">
{{ $t('labels.includeWebhook') }}
</a-checkbox>
</div>
</div>
<div class="flex flex-row gap-x-2 mt-2.5 pt-2.5 justify-end">
<NcButton key="back" type="secondary" @click="dialogShow = false">{{ $t('general.cancel') }}</NcButton>
<NcButton v-if="!isLoading" key="back" type="secondary" @click="dialogShow = false">{{ $t('general.cancel') }}</NcButton>
<NcButton key="submit" v-e="['a:base:duplicate']" :loading="isLoading" @click="_duplicate"
>{{ $t('general.confirm') }}
</NcButton>

46
packages/nc-gui/components/dlg/SharedBaseDuplicate.vue

@ -4,7 +4,6 @@ import { isEeUI, useApi, useVModel, useWorkspace } from '#imports'
const props = defineProps<{
modelValue: boolean
onOk: (jobData: { name: string; id: string }) => Promise<void>
}>()
const emit = defineEmits(['update:modelValue'])
@ -13,7 +12,13 @@ const { api } = useApi()
const { sharedBaseId } = useCopySharedBase()
const { workspacesList } = storeToRefs(useWorkspace())
const workspaceStore = useWorkspace()
const { populateWorkspace } = workspaceStore
const { workspacesList } = storeToRefs(workspaceStore)
const { ncNavigateTo } = useGlobal()
const dialogShow = useVModel(props, 'modelValue', emit)
@ -34,6 +39,8 @@ const isLoading = ref(false)
const selectedWorkspace = ref<string>()
const { $e, $poller } = useNuxtApp()
const _duplicate = async () => {
if (!selectedWorkspace.value && isEeUI) return
@ -51,10 +58,41 @@ const _duplicate = async () => {
sharedBaseId.value = null
props.onOk({ ...jobData, workspace_id: selectedWorkspace.value } as any)
$poller.subscribe(
{ id: jobData.id },
async (data: {
id: string
status?: string
data?: {
error?: {
message: string
}
message?: string
result?: any
}
}) => {
if (data.status !== 'close') {
if (data.status === JobStatus.COMPLETED) {
console.log('job completed', jobData)
await ncNavigateTo({
...(isEeUI ? { workspaceId: jobData.fk_workspace_id } : {}),
baseId: jobData.base_id,
})
isLoading.value = false
dialogShow.value = false
} else if (data.status === JobStatus.FAILED) {
message.error('Failed to duplicate shared base')
await populateWorkspace()
isLoading.value = false
dialogShow.value = false
}
}
},
)
$e('a:base:duplicate-shared-base')
} catch (e: any) {
message.error(await extractSdkResponseErrorMsg(e))
} finally {
isLoading.value = false
dialogShow.value = false
}

75
packages/nc-gui/components/dlg/TableDuplicate.vue

@ -1,11 +1,12 @@
<script setup lang="ts">
import type { TableType } from 'nocodb-sdk'
import { message } from 'ant-design-vue'
import { useVModel } from '#imports'
import type { TabType } from '#imports'
const props = defineProps<{
modelValue: boolean
table: TableType
onOk: (jobData: { name: string; id: string }) => Promise<void>
}>()
const emit = defineEmits(['update:modelValue'])
@ -14,6 +15,26 @@ const { api } = useApi()
const dialogShow = useVModel(props, 'modelValue', emit)
const { addTab } = useTabs()
const { $e, $poller } = useNuxtApp()
const basesStore = useBases()
const { createProject: _createProject } = basesStore
const { openTable } = useTablesStore()
const baseStore = useBase()
const { loadTables } = baseStore
const { tables } = storeToRefs(baseStore)
const { t } = useI18n()
const { activeTable: _activeTable } = storeToRefs(useTablesStore())
const { refreshCommandPalette } = useCommandPalette()
const options = ref({
@ -37,13 +58,45 @@ const _duplicate = async () => {
try {
isLoading.value = true
const jobData = await api.dbTable.duplicate(props.table.base_id!, props.table.id!, { options: optionsToExclude.value })
props.onOk(jobData as any)
$poller.subscribe(
{ id: jobData.id },
async (data: {
id: string
status?: string
data?: {
error?: {
message: string
}
message?: string
result?: any
}
}) => {
if (data.status !== 'close') {
if (data.status === JobStatus.COMPLETED) {
await loadTables()
refreshCommandPalette()
const newTable = tables.value.find((el) => el.id === data?.data?.result?.id)
if (newTable) addTab({ title: newTable.title, id: newTable.id, type: newTable.type as TabType })
openTable(newTable!)
isLoading.value = false
dialogShow.value = false
} else if (data.status === JobStatus.FAILED) {
message.error(t('msg.error.failedToDuplicateTable'))
await loadTables()
isLoading.value = false
dialogShow.value = false
}
}
},
)
$e('a:table:duplicate')
} catch (e: any) {
message.error(await extractSdkResponseErrorMsg(e))
} finally {
isLoading.value = false
dialogShow.value = false
refreshCommandPalette()
}
}
@ -61,10 +114,12 @@ const isEaster = ref(false)
<GeneralModal
v-model:visible="dialogShow"
:class="{ active: dialogShow }"
:closable="!isLoading"
:mask-closable="!isLoading"
:keyboard="!isLoading"
centered
wrap-class-name="nc-modal-table-duplicate"
:footer="null"
:closable="false"
class="!w-[30rem]"
@keydown.esc="dialogShow = false"
>
@ -80,13 +135,15 @@ const isEaster = ref(false)
<a-divider class="!m-0 !p-0 !my-2" />
<div class="text-xs p-2">
<a-checkbox v-model:checked="options.includeData">{{ $t('labels.includeData') }}</a-checkbox>
<a-checkbox v-model:checked="options.includeViews">{{ $t('labels.includeView') }}</a-checkbox>
<a-checkbox v-show="isEaster" v-model:checked="options.includeHooks">{{ $t('labels.includeWebhook') }}</a-checkbox>
<a-checkbox v-model:checked="options.includeData" :disabled="isLoading">{{ $t('labels.includeData') }}</a-checkbox>
<a-checkbox v-model:checked="options.includeViews" :disabled="isLoading">{{ $t('labels.includeView') }}</a-checkbox>
<a-checkbox v-show="isEaster" v-model:checked="options.includeHooks" :disabled="isLoading">
{{ $t('labels.includeWebhook') }}
</a-checkbox>
</div>
</div>
<div class="flex flex-row gap-x-2 mt-2.5 pt-2.5 justify-end">
<NcButton key="back" type="secondary" @click="dialogShow = false">{{ $t('general.cancel') }}</NcButton>
<NcButton v-if="!isLoading" key="back" type="secondary" @click="dialogShow = false">{{ $t('general.cancel') }}</NcButton>
<NcButton key="submit" v-e="['a:table:duplicate']" type="primary" :loading="isLoading" @click="_duplicate"
>{{ $t('general.confirm') }}
</NcButton>

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

@ -10,7 +10,7 @@ const { base } = storeToRefs(useBase())
const route = useRoute()
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>

2
packages/nc-gui/components/nc/Pagination.vue

@ -4,7 +4,7 @@ const props = defineProps<{
total: number
pageSize: number
entityName?: string
mode: 'simple' | 'full'
mode?: 'simple' | 'full'
}>()
const emits = defineEmits(['update:current', 'update:pageSize'])

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

@ -84,7 +84,7 @@ const selectedLangName = ref(langs[0].name)
const apiUrl = computed(
() =>
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) || '/',
).href,
)

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

@ -84,7 +84,7 @@ const selectedLangName = ref(langs[0].name)
const apiUrl = computed(
() =>
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) || '/',
).href,
)

43
packages/nc-gui/components/workspace/ProjectList.vue

@ -11,19 +11,16 @@ const { updateProjectTitle } = workspaceStore
const { activePage } = storeToRefs(workspaceStore)
const basesStore = useBases()
const { loadProjects } = basesStore
const { basesList, isProjectsLoading } = storeToRefs(basesStore)
const { navigateToProject } = useGlobal()
// const filteredProjects = computed(() => bases.value?.filter((p) => !p.deleted) || [])
const { $e, $poller } = useNuxtApp()
const { $e } = useNuxtApp()
const { isUIAllowed } = useRoles()
const { refreshCommandPalette } = useCommandPalette()
const showProjectDeleteModal = ref(false)
const toBeDeletedProjectId = ref<string | undefined>()
@ -142,37 +139,6 @@ const workspaceMoveProjectOnSuccess = async (workspaceId: string) => {
const isDuplicateDlgOpen = ref(false)
const selectedProjectToDuplicate = ref()
const DlgProjectDuplicateOnOk = async (jobData: { id: string }) => {
await loadProjects('workspace')
$poller.subscribe(
{ id: jobData.id },
async (data: {
id: string
status?: string
data?: {
error?: {
message: string
}
message?: string
result?: any
}
}) => {
if (data.status !== 'close') {
if (data.status === JobStatus.COMPLETED) {
await loadProjects('workspace')
refreshCommandPalette()
} else if (data.status === JobStatus.FAILED) {
message.error('Failed to duplicate base')
await loadProjects('workspace')
}
}
},
)
$e('a:base:duplicate')
}
const duplicateProject = (base: BaseType) => {
selectedProjectToDuplicate.value = base
isDuplicateDlgOpen.value = true
@ -404,12 +370,7 @@ const setIcon = async (icon: string, base: BaseType) => {
:base="selectedProjectToMove"
@success="workspaceMoveProjectOnSuccess"
/>
<DlgProjectDuplicate
v-if="selectedProjectToDuplicate"
v-model="isDuplicateDlgOpen"
:base="selectedProjectToDuplicate"
:on-ok="DlgProjectDuplicateOnOk"
/>
<DlgProjectDuplicate v-if="selectedProjectToDuplicate" v-model="isDuplicateDlgOpen" :base="selectedProjectToDuplicate" />
</div>
</template>

43
packages/nc-gui/pages/index.vue

@ -16,7 +16,7 @@ const basesStore = useBases()
const { populateWorkspace } = useWorkspace()
const { signedIn, ncNavigateTo } = useGlobal()
const { signedIn } = useGlobal()
const { isUIAllowed } = useRoles()
@ -121,40 +121,6 @@ function toggleDialog(value?: boolean, key?: string, dsState?: string, pId?: str
}
provide(ToggleDialogInj, toggleDialog)
const { $e, $poller } = useNuxtApp()
const DlgSharedBaseDuplicateOnOk = async (jobData: { id: string; base_id: string; workspace_id: string }) => {
await populateWorkspace()
$poller.subscribe(
{ id: jobData.id },
async (data: {
id: string
status?: string
data?: {
error?: {
message: string
}
message?: string
result?: any
}
}) => {
if (data.status !== 'close') {
if (data.status === JobStatus.COMPLETED) {
await ncNavigateTo({
baseId: jobData.base_id,
})
} else if (data.status === JobStatus.FAILED) {
message.error('Failed to duplicate shared base')
await populateWorkspace()
}
}
},
)
$e('a:base:duplicate-shared-base')
}
</script>
<template>
@ -179,12 +145,7 @@ const DlgSharedBaseDuplicateOnOk = async (jobData: { id: string; base_id: string
v-model:data-sources-state="dataSourcesState"
:base-id="baseId"
/>
<DlgSharedBaseDuplicate
v-if="isUIAllowed('baseDuplicate')"
v-model="isDuplicateDlgOpen"
:shared-base-id="sharedBaseId"
:on-ok="DlgSharedBaseDuplicateOnOk"
/>
<DlgSharedBaseDuplicate v-if="isUIAllowed('baseDuplicate')" v-model="isDuplicateDlgOpen" />
</div>
</template>

6
packages/nc-gui/store/config.ts

@ -7,7 +7,9 @@ export const useConfigStore = defineStore('configStore', () => {
const sidebarStore = useSidebarStore()
const viewsStore = useViewsStore()
const { activeViewTitleOrId } = storeToRefs(viewsStore)
const tablesStore = useTablesStore()
const { activeTableId } = storeToRefs(tablesStore)
const isViewPortMobile = () => width.value < MAX_WIDTH_FOR_MOBILE_MODE
@ -47,7 +49,7 @@ export const useConfigStore = defineStore('configStore', () => {
const handleSidebarOpenOnMobileForNonViews = () => {
if (!isViewPortMobile()) return
if (!viewsStore.activeViewTitleOrId && !tablesStore.activeTableId) {
if (!activeViewTitleOrId && !activeTableId) {
nextTick(() => {
sidebarStore.isLeftSidebarOpen = true
})
@ -56,7 +58,7 @@ export const useConfigStore = defineStore('configStore', () => {
}
}
watch([viewsStore.activeViewTitleOrId, tablesStore.activeTableId], () => {
watch([activeViewTitleOrId, activeTableId], () => {
handleSidebarOpenOnMobileForNonViews()
})

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

@ -20,7 +20,7 @@ export class ApiDocsController {
@Get([
'/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)
@Acl('swaggerJson')
@ -34,7 +34,7 @@ export class ApiDocsController {
}
@Get([
'/api/v1/meta/bases/:baseId/swagger',
'/api/v2/meta/bases/:baseId/swagger',
'/api/v1/db/meta/projects/:baseId/swagger',
])
@UseGuards(PublicApiLimiterGuard)
@ -45,7 +45,7 @@ export class ApiDocsController {
@UseGuards(PublicApiLimiterGuard)
@Get([
'/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) {
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([
'/api/v1/db/meta/projects/:baseId/api-tokens',
'/api/v1/meta/bases/:baseId/api-tokens',
'/api/v2/meta/bases/:baseId/api-tokens',
])
@Acl('baseApiTokenList')
async apiTokenList(@Request() req) {
@ -33,7 +33,7 @@ export class ApiTokensController {
@Post([
'/api/v1/db/meta/projects/:baseId/api-tokens',
'/api/v1/meta/bases/:baseId/api-tokens',
'/api/v2/meta/bases/:baseId/api-tokens',
])
@HttpCode(200)
@Acl('baseApiTokenCreate')
@ -46,7 +46,7 @@ export class ApiTokensController {
@Delete([
'/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')
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) {}
@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)
@UseInterceptors(UploadAllowedInterceptor, AnyFilesInterceptor())
async upload(@UploadedFiles() files: Array<any>, @Request() req) {
@ -40,7 +40,7 @@ export class AttachmentsSecureController {
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)
@UseInterceptors(UploadAllowedInterceptor)
@UseGuards(MetaApiLimiterGuard, GlobalGuard)

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

@ -25,7 +25,7 @@ export class AttachmentsController {
constructor(private readonly attachmentsService: AttachmentsService) {}
@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)
@UseInterceptors(UploadAllowedInterceptor, AnyFilesInterceptor())
async upload(
@ -41,7 +41,7 @@ export class AttachmentsController {
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)
@UseInterceptors(UploadAllowedInterceptor)
@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 {
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)
@Acl('commentRow')
async commentRow(@Request() req) {
@ -33,7 +33,7 @@ export class AuditsController {
@Post([
'/api/v1/db/meta/audits/rows/:rowId/update',
'/api/v1/meta/audits/rows/:rowId/update',
'/api/v2/meta/audits/rows/:rowId/update',
])
@HttpCode(200)
@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')
async commentList(@Request() req) {
return new PagedResponseImpl(
@ -54,7 +54,7 @@ export class AuditsController {
@Patch([
'/api/v1/db/meta/audits/:auditId/comment',
'/api/v1/meta/audits/:auditId/comment',
'/api/v2/meta/audits/:auditId/comment',
])
@Acl('commentUpdate')
async commentUpdate(
@ -71,7 +71,7 @@ export class AuditsController {
@Get([
'/api/v1/db/meta/projects/:baseId/audits/',
'/api/v1/meta/bases/:baseId/audits/',
'/api/v2/meta/bases/:baseId/audits/',
])
@Acl('auditList')
async auditList(@Request() req, @Param('baseId') baseId: string) {
@ -89,7 +89,7 @@ export class AuditsController {
@Get([
'/api/v1/db/meta/audits/comments/count',
'/api/v1/meta/audits/comments/count',
'/api/v2/meta/audits/comments/count',
])
@Acl('commentsCount')
async commentsCount(

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

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

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

@ -31,7 +31,7 @@ export class BasesController {
@Acl('baseList', {
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) {
const bases = await this.projectsService.baseList({
user: req.user,
@ -46,7 +46,7 @@ export class BasesController {
@Acl('baseInfoGet')
@Get([
'/api/v1/db/meta/projects/:baseId/info',
'/api/v1/meta/bases/:baseId/info',
'/api/v2/meta/bases/:baseId/info',
])
async baseInfoGet() {
return {
@ -60,7 +60,7 @@ export class BasesController {
}
@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) {
const base = await this.projectsService.getProjectWithInfo({
baseId: baseId,
@ -72,7 +72,7 @@ export class BasesController {
}
@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(
@Param('baseId') baseId: string,
@Body() body: Record<string, any>,
@ -88,7 +88,7 @@ export class BasesController {
}
@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) {
const deleted = await this.projectsService.baseSoftDelete({
baseId,
@ -101,7 +101,7 @@ export class BasesController {
@Acl('baseCreate', {
scope: 'org',
})
@Post(['/api/v1/db/meta/projects', '/api/v1/meta/bases'])
@Post(['/api/v1/db/meta/projects', '/api/v2/meta/bases'])
@HttpCode(200)
async baseCreate(@Body() baseBody: ProjectReqType, @Request() req) {
const base = await this.projectsService.baseCreate({
@ -115,7 +115,7 @@ export class BasesController {
@Acl('hasEmptyOrNullFilters')
@Get([
'/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) {
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 {
constructor(private bulkDataAliasService: BulkDataAliasService) {}
@Post([
'/api/v1/db/data/bulk/:orgs/:baseName/:tableName',
'/api/v1/data/bulk/:orgs/:baseName/:tableName',
])
@Post(['/api/v1/db/data/bulk/:orgs/:baseName/:tableName'])
@HttpCode(200)
@Acl('bulkDataInsert')
async bulkDataInsert(
@ -43,10 +40,7 @@ export class BulkDataAliasController {
res.json(exists);
}
@Patch([
'/api/v1/db/data/bulk/:orgs/:baseName/:tableName',
'/api/v1/data/bulk/:orgs/:baseName/:tableName',
])
@Patch(['/api/v1/db/data/bulk/:orgs/:baseName/:tableName'])
@Acl('bulkDataUpdate')
async bulkDataUpdate(
@Request() req,
@ -63,10 +57,7 @@ export class BulkDataAliasController {
}
// todo: Integrate with filterArrJson bulkDataUpdateAll
@Patch([
'/api/v1/db/data/bulk/:orgs/:baseName/:tableName/all',
'/api/v1/data/bulk/:orgs/:baseName/:tableName/all',
])
@Patch(['/api/v1/db/data/bulk/:orgs/:baseName/:tableName/all'])
@Acl('bulkDataUpdateAll')
async bulkDataUpdateAll(
@Request() req,
@ -83,10 +74,7 @@ export class BulkDataAliasController {
});
}
@Delete([
'/api/v1/db/data/bulk/:orgs/:baseName/:tableName',
'/api/v1/data/bulk/:orgs/:baseName/:tableName',
])
@Delete(['/api/v1/db/data/bulk/:orgs/:baseName/:tableName'])
@Acl('bulkDataDelete')
async bulkDataDelete(
@Request() req,
@ -104,10 +92,7 @@ export class BulkDataAliasController {
// todo: Integrate with filterArrJson bulkDataDeleteAll
@Delete([
'/api/v1/db/data/bulk/:orgs/:baseName/:tableName/all',
'/api/v1/data/bulk/:orgs/:baseName/:tableName/all',
])
@Delete(['/api/v1/db/data/bulk/:orgs/:baseName/:tableName/all'])
@Acl('bulkDataDeleteAll')
async bulkDataDeleteAll(
@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 {
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', {
scope: 'org',
allowedRoles: [OrgUserRoles.SUPER_ADMIN],
@ -25,7 +25,7 @@ export class CachesController {
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', {
scope: 'org',
allowedRoles: [OrgUserRoles.SUPER_ADMIN],

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

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

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

@ -15,8 +15,6 @@ export class DataAliasExportController {
@Get([
'/api/v1/db/data/:orgs/:baseName/:tableName/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')
async excelDataExport(@Request() req, @Response() res) {
@ -44,8 +42,6 @@ export class DataAliasExportController {
@Get([
'/api/v1/db/data/:orgs/:baseName/:tableName/views/:viewName/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')
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) {}
// todo: handle case where the given column is not ltar
@Get([
'/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/mm/:columnName',
'/api/v1/data/:orgs/:baseName/:tableName/:rowId/mm/:columnName',
])
@Get(['/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/mm/:columnName'])
@Acl('mmList')
async mmList(
@Request() req,
@ -42,7 +39,6 @@ export class DataAliasNestedController {
@Get([
'/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/mm/:columnName/exclude',
'/api/v1/data/:orgs/:baseName/:tableName/:rowId/mm/:columnName/exclude',
])
@Acl('mmExcludedList')
async mmExcludedList(
@ -63,7 +59,6 @@ export class DataAliasNestedController {
@Get([
'/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/hm/:columnName/exclude',
'/api/v1/data/:orgs/:baseName/:tableName/:rowId/hm/:columnName/exclude',
])
@Acl('hmExcludedList')
async hmExcludedList(
@ -84,7 +79,6 @@ export class DataAliasNestedController {
@Get([
'/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/bt/:columnName/exclude',
'/api/v1/data/:orgs/:baseName/:tableName/:rowId/bt/:columnName/exclude',
])
@Acl('btExcludedList')
async btExcludedList(
@ -105,10 +99,7 @@ export class DataAliasNestedController {
// todo: handle case where the given column is not ltar
@Get([
'/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/hm/:columnName',
'/api/v1/data/:orgs/:baseName/:tableName/:rowId/hm/:columnName',
])
@Get(['/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/hm/:columnName'])
@Acl('hmList')
async hmList(
@Request() req,
@ -128,7 +119,6 @@ export class DataAliasNestedController {
@Delete([
'/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/:relationType/:columnName/:refRowId',
'/api/v1/data/:orgs/:baseName/:tableName/:rowId/:relationType/:columnName/:refRowId',
])
@Acl('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
@Post([
'/api/v1/db/data/:orgs/:baseName/:tableName/:rowId/:relationType/:columnName/:refRowId',
'/api/v1/data/:orgs/:baseName/:tableName/:rowId/:relationType/:columnName/:refRowId',
])
@Acl('relationDataAdd')
@HttpCode(200)

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

@ -27,8 +27,6 @@ export class DataAliasController {
@Get([
'/api/v1/db/data/:orgs/:baseName/:tableName',
'/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')
async dataList(
@ -61,8 +59,6 @@ export class DataAliasController {
@Get([
'/api/v1/db/data/:orgs/:baseName/:tableName/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')
async dataFindOne(
@ -82,8 +78,6 @@ export class DataAliasController {
@Get([
'/api/v1/db/data/:orgs/:baseName/:tableName/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')
async dataGroupBy(
@ -103,8 +97,6 @@ export class DataAliasController {
@Get([
'/api/v1/db/data/:orgs/:baseName/:tableName/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')
async dataCount(
@ -127,8 +119,6 @@ export class DataAliasController {
@Post([
'/api/v1/db/data/:orgs/:baseName/:tableName',
'/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)
@Acl('dataInsert')
@ -153,8 +143,6 @@ export class DataAliasController {
@Patch([
'/api/v1/db/data/:orgs/:baseName/:tableName/: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')
async dataUpdate(
@ -179,8 +167,6 @@ export class DataAliasController {
@Delete([
'/api/v1/db/data/:orgs/:baseName/:tableName/: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')
async dataDelete(
@ -202,8 +188,6 @@ export class DataAliasController {
@Get([
'/api/v1/db/data/:orgs/:baseName/:tableName/: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')
async dataRead(
@ -229,8 +213,6 @@ export class DataAliasController {
@Get([
'/api/v1/db/data/:orgs/:baseName/:tableName/: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')
async dataExist(
@ -257,8 +239,6 @@ export class DataAliasController {
@Get([
'/api/v1/db/data/:orgs/:baseName/:tableName/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')
async groupedDataList(

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

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

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

@ -13,7 +13,7 @@ export class FormColumnsController {
@Patch([
'/api/v1/db/meta/form-columns/:formViewColumnId',
'/api/v1/meta/form-columns/:formViewColumnId',
'/api/v2/meta/form-columns/:formViewColumnId',
])
@Acl('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 {
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')
async formViewGet(@Param('formViewId') formViewId: string) {
const formViewData = await this.formsService.formViewGet({
@ -31,7 +31,7 @@ export class FormsController {
@Post([
'/api/v1/db/meta/tables/:tableId/forms',
'/api/v1/meta/tables/:tableId/forms',
'/api/v2/meta/tables/:tableId/forms',
])
@HttpCode(200)
@Acl('formViewCreate')
@ -49,7 +49,7 @@ export class FormsController {
}
@Patch([
'/api/v1/db/meta/forms/:formViewId',
'/api/v1/meta/forms/:formViewId',
'/api/v2/meta/forms/:formViewId',
])
@Acl('formViewUpdate')
async formViewUpdate(@Param('formViewId') formViewId: string, @Body() body) {

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

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

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

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

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

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

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

@ -25,7 +25,7 @@ export class HooksController {
@Get([
'/api/v1/db/meta/tables/:tableId/hooks',
'/api/v1/meta/tables/:tableId/hooks',
'/api/v2/meta/tables/:tableId/hooks',
])
@Acl('hookList')
async hookList(@Param('tableId') tableId: string) {
@ -34,7 +34,7 @@ export class HooksController {
@Post([
'/api/v1/db/meta/tables/:tableId/hooks',
'/api/v1/meta/tables/:tableId/hooks',
'/api/v2/meta/tables/:tableId/hooks',
])
@HttpCode(200)
@Acl('hookCreate')
@ -49,13 +49,13 @@ export class HooksController {
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')
async hookDelete(@Param('hookId') hookId: string) {
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')
async hookUpdate(@Param('hookId') hookId: string, @Body() body: HookReqType) {
return await this.hooksService.hookUpdate({ hookId, hook: body });
@ -63,7 +63,7 @@ export class HooksController {
@Post([
'/api/v1/db/meta/tables/:tableId/hooks/test',
'/api/v1/meta/tables/:tableId/hooks/test',
'/api/v2/meta/tables/:tableId/hooks/test',
])
@HttpCode(200)
@Acl('hookTest')
@ -88,7 +88,7 @@ export class HooksController {
@Get([
'/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')
async tableSampleData(
@ -105,7 +105,7 @@ export class HooksController {
@Get([
'/api/v1/db/meta/hooks/:hookId/logs',
'/api/v1/meta/hooks/:hookId/logs',
'/api/v2/meta/hooks/:hookId/logs',
])
@Acl('hookLogList')
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([
'/api/v1/db/meta/kanbans/:kanbanViewId',
'/api/v1/meta/kanbans/:kanbanViewId',
'/api/v2/meta/kanbans/:kanbanViewId',
])
@Acl('kanbanViewGet')
async kanbanViewGet(@Param('kanbanViewId') kanbanViewId: string) {
@ -33,7 +33,7 @@ export class KanbansController {
@Post([
'/api/v1/db/meta/tables/:tableId/kanbans',
'/api/v1/meta/tables/:tableId/kanbans',
'/api/v2/meta/tables/:tableId/kanbans',
])
@HttpCode(200)
@Acl('kanbanViewCreate')
@ -51,7 +51,7 @@ export class KanbansController {
@Patch([
'/api/v1/db/meta/kanbans/:kanbanViewId',
'/api/v1/meta/kanbans/:kanbanViewId',
'/api/v2/meta/kanbans/:kanbanViewId',
])
@Acl('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 {
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')
async mapViewGet(@Param('mapViewId') mapViewId: string) {
return await this.mapsService.mapViewGet({ mapViewId });
@ -28,7 +28,7 @@ export class MapsController {
@Post([
'/api/v1/db/meta/tables/:tableId/maps',
'/api/v1/meta/tables/:tableId/maps',
'/api/v2/meta/tables/:tableId/maps',
])
@HttpCode(200)
@Acl('mapViewCreate')
@ -45,7 +45,7 @@ export class MapsController {
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')
async mapViewUpdate(
@Param('mapViewId') mapViewId: string,

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

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

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

@ -22,7 +22,7 @@ export class ModelVisibilitiesController {
@Post([
'/api/v1/db/meta/projects/:baseId/visibility-rules',
'/api/v1/meta/bases/:baseId/visibility-rules',
'/api/v2/meta/bases/:baseId/visibility-rules',
])
@HttpCode(200)
@Acl('modelVisibilitySet')
@ -40,7 +40,7 @@ export class ModelVisibilitiesController {
@Get([
'/api/v1/db/meta/projects/:baseId/visibility-rules',
'/api/v1/meta/bases/:baseId/visibility-rules',
'/api/v2/meta/bases/:baseId/visibility-rules',
])
@Acl('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 {
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', {
scope: 'org',
})
@ -34,7 +34,7 @@ export class PluginsController {
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', {
scope: 'org',
})
@ -42,7 +42,7 @@ export class PluginsController {
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)
@Acl('pluginTest', {
scope: 'org',
@ -51,7 +51,7 @@ export class PluginsController {
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', {
scope: 'org',
})
@ -61,7 +61,7 @@ export class PluginsController {
@Patch([
'/api/v1/db/meta/plugins/:pluginId',
'/api/v1/meta/plugins/:pluginId',
'/api/v2/meta/plugins/:pluginId',
])
@Acl('pluginUpdate', {
scope: 'org',
@ -76,7 +76,7 @@ export class PluginsController {
@Get([
'/api/v1/db/meta/plugins/:pluginTitle/status',
'/api/v1/meta/plugins/:pluginTitle/status',
'/api/v2/meta/plugins/:pluginTitle/status',
])
@Acl('isPluginActive', {
scope: 'org',

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

@ -27,7 +27,7 @@ export class PublicDatasExportController {
@Get([
'/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(
@Request() req,
@ -82,7 +82,7 @@ export class PublicDatasExportController {
@Get([
'/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) {
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([
'/api/v1/db/public/shared-view/:sharedViewUuid/rows',
'/api/v1/public/shared-view/:sharedViewUuid/rows',
'/api/v2/public/shared-view/:sharedViewUuid/rows',
])
async dataList(
@Request() req,
@ -35,7 +35,7 @@ export class PublicDatasController {
@Get([
'/api/v1/db/public/shared-view/:sharedViewUuid/groupby',
'/api/v1/public/shared-view/:sharedViewUuid/groupby',
'/api/v2/public/shared-view/:sharedViewUuid/groupby',
])
async dataGroupBy(
@Request() req,
@ -50,7 +50,7 @@ export class PublicDatasController {
@Get([
'/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(
@Request() req,
@ -68,7 +68,7 @@ export class PublicDatasController {
@Post([
'/api/v1/db/public/shared-view/:sharedViewUuid/rows',
'/api/v1/public/shared-view/:sharedViewUuid/rows',
'/api/v2/public/shared-view/:sharedViewUuid/rows',
])
@HttpCode(200)
@UseInterceptors(AnyFilesInterceptor())
@ -89,7 +89,7 @@ export class PublicDatasController {
@Get([
'/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(
@Request() req,
@ -108,7 +108,7 @@ export class PublicDatasController {
@Get([
'/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(
@Request() req,
@ -128,7 +128,7 @@ export class PublicDatasController {
@Get([
'/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(
@Request() req,

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

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

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

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

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

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

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

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

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

@ -18,7 +18,7 @@ export class SqlViewsController {
@Post([
'/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')
async sqlViewCreate(

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

@ -23,8 +23,8 @@ export class SyncController {
@Get([
'/api/v1/db/meta/projects/:baseId/syncs',
'/api/v1/db/meta/projects/:baseId/syncs/:sourceId',
'/api/v1/meta/bases/:baseId/syncs',
'/api/v1/meta/bases/:baseId/syncs/:sourceId',
'/api/v2/meta/bases/:baseId/syncs',
'/api/v2/meta/bases/:baseId/syncs/:sourceId',
])
@Acl('syncSourceList')
async syncSourceList(
@ -40,8 +40,8 @@ export class SyncController {
@Post([
'/api/v1/db/meta/projects/:baseId/syncs',
'/api/v1/db/meta/projects/:baseId/syncs/:sourceId',
'/api/v1/meta/bases/:baseId/syncs',
'/api/v1/meta/bases/:baseId/syncs/:sourceId',
'/api/v2/meta/bases/:baseId/syncs',
'/api/v2/meta/bases/:baseId/syncs/:sourceId',
])
@HttpCode(200)
@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')
async syncDelete(@Param('syncId') syncId: string) {
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')
async syncUpdate(@Param('syncId') syncId: string, @Body() body: any) {
return await this.syncService.syncUpdate({

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

@ -26,8 +26,8 @@ export class TablesController {
@Get([
'/api/v1/db/meta/projects/:baseId/tables',
'/api/v1/db/meta/projects/:baseId/:sourceId/tables',
'/api/v1/meta/bases/:baseId/tables',
'/api/v1/meta/bases/:baseId/:sourceId/tables',
'/api/v2/meta/bases/:baseId/tables',
'/api/v2/meta/bases/:baseId/:sourceId/tables',
])
@Acl('tableList')
async tableList(
@ -49,8 +49,8 @@ export class TablesController {
@Post([
'/api/v1/db/meta/projects/:baseId/tables',
'/api/v1/db/meta/projects/:baseId/:sourceId/tables',
'/api/v1/meta/bases/:baseId/tables',
'/api/v1/meta/bases/:baseId/:sourceId/tables',
'/api/v2/meta/bases/:baseId/tables',
'/api/v2/meta/bases/:baseId/:sourceId/tables',
])
@HttpCode(200)
@Acl('tableCreate')
@ -70,7 +70,7 @@ export class TablesController {
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')
async tableGet(@Param('tableId') tableId: string, @Request() req) {
const table = await this.tablesService.getTableWithAccessibleViews({
@ -81,7 +81,7 @@ export class TablesController {
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')
async tableUpdate(
@Param('tableId') tableId: string,
@ -97,7 +97,7 @@ export class TablesController {
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')
async tableDelete(@Param('tableId') tableId: string, @Request() req) {
const result = await this.tablesService.tableDelete({
@ -111,7 +111,7 @@ export class TablesController {
@Post([
'/api/v1/db/meta/tables/:tableId/reorder',
'/api/v1/meta/tables/:tableId/reorder',
'/api/v2/meta/tables/:tableId/reorder',
])
@Acl('tableReorder')
@HttpCode(200)

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

@ -39,7 +39,7 @@ export class UtilsController {
}
@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', {
scope: 'org',
})
@ -49,7 +49,12 @@ export class UtilsController {
}
@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',
// todo: remove this once we added the health api
'/api/v1/meta/nocodb/info',
])
async appInfo(@Request() req) {
return await this.utilsService.appInfo({
req: {
@ -65,7 +70,7 @@ export class UtilsController {
}
@UseGuards(PublicApiLimiterGuard)
@Post(['/api/v1/db/meta/axiosRequestMake', '/api/v1/meta/axiosRequestMake'])
@Post(['/api/v1/db/meta/axiosRequestMake', '/api/v2/meta/axiosRequestMake'])
@HttpCode(200)
async axiosRequestMake(@Body() body: any) {
return await this.utilsService.axiosRequestMake({ body });

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

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

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

@ -25,7 +25,7 @@ export class ViewsController {
@Get([
'/api/v1/db/meta/tables/:tableId/views',
'/api/v1/meta/tables/:tableId/views',
'/api/v2/meta/tables/:tableId/views',
])
@Acl('viewList')
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')
async viewUpdate(
@Param('viewId') viewId: string,
@ -52,7 +52,7 @@ export class ViewsController {
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')
async viewDelete(@Param('viewId') viewId: string, @Request() req) {
const result = await this.viewsService.viewDelete({
@ -64,7 +64,7 @@ export class ViewsController {
@Post([
'/api/v1/db/meta/views/:viewId/show-all',
'/api/v1/meta/views/:viewId/show-all',
'/api/v2/meta/views/:viewId/show-all',
])
@HttpCode(200)
@Acl('showAllColumns')
@ -79,7 +79,7 @@ export class ViewsController {
}
@Post([
'/api/v1/db/meta/views/:viewId/hide-all',
'/api/v1/meta/views/:viewId/hide-all',
'/api/v2/meta/views/:viewId/hide-all',
])
@HttpCode(200)
@Acl('hideAllColumns')
@ -95,7 +95,7 @@ export class ViewsController {
@Post([
'/api/v1/db/meta/views/:viewId/share',
'/api/v1/meta/views/:viewId/share',
'/api/v2/meta/views/:viewId/share',
])
@HttpCode(200)
@Acl('shareView')
@ -105,7 +105,7 @@ export class ViewsController {
@Get([
'/api/v1/db/meta/tables/:tableId/share',
'/api/v1/meta/tables/:tableId/share',
'/api/v2/meta/tables/:tableId/share',
])
@Acl('shareViewList')
async shareViewList(@Param('tableId') tableId: string) {
@ -118,7 +118,7 @@ export class ViewsController {
@Patch([
'/api/v1/db/meta/views/:viewId/share',
'/api/v1/meta/views/:viewId/share',
'/api/v2/meta/views/:viewId/share',
])
@Acl('shareViewUpdate')
async shareViewUpdate(
@ -135,7 +135,7 @@ export class ViewsController {
@Delete([
'/api/v1/db/meta/views/:viewId/share',
'/api/v1/meta/views/:viewId/share',
'/api/v2/meta/views/:viewId/share',
])
@Acl('shareViewDelete')
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/comments',
'/api/v1/meta/audits/rows/:rowId/update',
'/api/v1/meta/audits/comments',
'/api/v2/meta/audits/rows/:rowId/update',
'/api/v2/meta/audits/comments',
].some(
(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',
'/api/v1/meta/audits/comments/count',
'/api/v1/meta/audits/comments',
'/api/v2/meta/audits/comments/count',
'/api/v2/meta/audits/comments',
].some((auditReadPath) => req.route.path === auditReadPath) &&
req.method === 'GET' &&
req.query.fk_model_id
@ -163,9 +163,8 @@ export class ExtractIdsMiddleware implements NestMiddleware, CanActivate {
'/auth/user/me',
'/api/v1/db/auth/user/me',
'/api/v1/auth/user/me',
'/api/v1/auth/user/me',
'/api/v1/db/meta/plugins/webhook',
'/api/v1/meta/plugins/webhook',
'/api/v2/meta/plugins/webhook',
].some((userMePath) => req.route.path === userMePath) &&
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([
'/api/v1/db/meta/syncs/:syncId/trigger',
'/api/v1/meta/syncs/:syncId/trigger',
'/api/v2/meta/syncs/:syncId/trigger',
])
@Acl('airtableImport')
@HttpCode(200)
@ -60,7 +60,7 @@ export class AtImportController {
@Post([
'/api/v1/db/meta/syncs/:syncId/abort',
'/api/v1/meta/syncs/:syncId/abort',
'/api/v2/meta/syncs/:syncId/abort',
])
@Acl('airtableImport')
@HttpCode(200)

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

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

3
packages/nocodb/src/modules/jobs/jobs/export-import/import.service.ts

@ -34,6 +34,7 @@ import { ViewsService } from '~/services/views.service';
import NcPluginMgrv2 from '~/helpers/NcPluginMgrv2';
import { BulkDataAliasService } from '~/services/bulk-data-alias.service';
import NcConnectionMgrv2 from '~/utils/common/NcConnectionMgrv2';
import { sanitizeColumnName } from '~/helpers';
@Injectable()
export class ImportService {
@ -149,7 +150,7 @@ export class ImportService {
// map column id's with new created column id's
for (const col of table.columns) {
const colRef = modelData.columns.find(
(a) => a.column_name === col.column_name,
(a) => sanitizeColumnName(a.column_name) === col.column_name,
);
idMap.set(colRef.id, col.id);

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

@ -20,7 +20,7 @@ export class MetaSyncController {
@Post([
'/api/v1/db/meta/projects/:baseId/meta-diff',
'/api/v1/meta/bases/:baseId/meta-diff',
'/api/v2/meta/bases/:baseId/meta-diff',
])
@HttpCode(200)
@Acl('metaDiffSync')
@ -45,7 +45,7 @@ export class MetaSyncController {
@Post([
'/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)
@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) {}
@Post([
'/api/v1/db/meta/projects/:baseId/sources',
'/api/v1/meta/bases/:baseId/sources',
'/api/v1/db/meta/projects/:baseId/bases',
'/api/v2/meta/bases/:baseId/sources',
])
@HttpCode(200)
@Acl('baseCreate')

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

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

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

File diff suppressed because it is too large Load Diff

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

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

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

@ -25,7 +25,7 @@ export const getModelPaths = async (ctx: {
columns: SwaggerColumn[];
baseName: string;
}): Promise<{ [path: string]: any }> => ({
[`/api/v1/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}`]: {
[`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}`]: {
get: {
summary: `${ctx.tableName} 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],
...(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: {
summary: `${ctx.tableName} 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: {
summary: `${ctx.tableName} 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: {
summary: `${ctx.tableName} groupby`,
operationId: `${ctx.tableName.toLowerCase()}-groupby`,
@ -230,7 +230,7 @@ export const getModelPaths = async (ctx: {
},
...(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: {
summary: `${ctx.tableName} bulk insert`,
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],
patch: {
@ -352,7 +352,7 @@ export const getModelPaths = async (ctx: {
...(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: [
rowIdParam,
@ -376,7 +376,7 @@ export const getModelPaths = async (ctx: {
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: [
rowIdParam,
@ -417,7 +417,7 @@ export const getModelPaths = async (ctx: {
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: [
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],
get: {
summary: 'Rows export',
@ -478,7 +479,7 @@ export const getViewPaths = async (ctx: {
baseName: string;
columns: SwaggerColumn[];
}): 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: {
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: {
summary: `${ctx.viewName} count`,
@ -562,7 +563,7 @@ export const getViewPaths = async (ctx: {
},
...(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],
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],
get: {

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

@ -59,7 +59,7 @@ const defaultSharedBaseValue = {
const createSharedBase = async (app, token, base, sharedBaseArgs = {}) => {
await request(app)
.post(`/api/v1/meta/bases/${base.id}/shared`)
.post(`/api/v1/db/meta/projects/${base.id}/shared`)
.set('xc-auth', token)
.send({
...defaultSharedBaseValue,
@ -69,7 +69,7 @@ const createSharedBase = async (app, token, base, sharedBaseArgs = {}) => {
const createSakilaProject = async (context) => {
const response = await request(context.app)
.post('/api/v1/meta/bases/')
.post('/api/v1/db/meta/projects/')
.set('xc-auth', context.token)
.send(sakilaProjectConfig(context));
@ -81,7 +81,7 @@ const createProject = async (
baseArgs: ProjectArgs = defaultProjectValue,
) => {
const response = await request(context.app)
.post('/api/v1/meta/bases/')
.post('/api/v1/db/meta/projects/')
.set('xc-auth', context.token)
.send({
...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) => {
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)
.send({
...columnAttr,
@ -373,7 +373,7 @@ const updateViewColumn = async (
{ view, column, attr }: { column: Column; view: View; attr: any },
) => {
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)
.send({
...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 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);
if (response.status !== 200) {
@ -240,7 +240,7 @@ const getOneRow = async (
{ base, table }: { base: Base; table: Model },
) => {
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);
return response.body;
@ -281,7 +281,7 @@ const createRow = async (
const rowData = generateDefaultRowAttributes({ columns, index });
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)
.send(rowData);
@ -301,7 +301,7 @@ const createBulkRows = async (
},
) => {
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)
.send(values)
.expect(200);
@ -340,7 +340,7 @@ const createChildRow = async (
await request(context.app)
.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);

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

@ -12,7 +12,7 @@ const defaultTableValue = (context) => ({
const createTable = async (context, base, args = {}) => {
const defaultValue = defaultTableValue(context);
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)
.send({ ...defaultValue, ...args });

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

@ -31,7 +31,7 @@ const createView = async (
};
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)
.send({
title,
@ -53,7 +53,7 @@ const getView = async (
{ table, name }: { table: Model; name: string },
) => {
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);
if (response.status !== 200) {
throw new Error('List Views', response.body.message);
@ -85,7 +85,7 @@ const updateView = async (
if (filter.length) {
for (let i = 0; i < filter.length; i++) {
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)
.send(filter[i])
.expect(200);
@ -95,7 +95,7 @@ const updateView = async (
if (sort.length) {
for (let i = 0; i < sort.length; i++) {
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)
.send(sort[i])
.expect(200);
@ -113,7 +113,7 @@ const updateView = async (
).id;
// configure view to hide selected fields
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)
.send({ show: false })
.expect(200);

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

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

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

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

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

@ -57,7 +57,7 @@ function columnTypeSpecificTests() {
describe('Qr Code Column', () => {
it('delivers the same cell values as the referenced column', async () => {
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)
.expect(200);
expect(resp.body.list[0][qrValueReferenceColumnTitle]).to.eql(
@ -80,7 +80,7 @@ function columnTypeSpecificTests() {
).to.eq(true);
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)
.send({});

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

@ -147,7 +147,7 @@ async function retrieveRecordsAndValidate(
// retrieve filtered records
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)
.query({
filterArrJson: JSON.stringify([filter]),
@ -586,7 +586,7 @@ function filterSelectBased() {
async function applyDateFilter(filterParams, expectedRecords) {
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)
.query({
filterArrJson: JSON.stringify([filterParams]),

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

@ -34,7 +34,7 @@ function groupByTests() {
const columns = (
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)
.expect(200)
).body.list;
@ -45,7 +45,7 @@ function groupByTests() {
it('Check One GroupBy Column Ascending', async function () {
const lengthColumn = filmColumns.find((c) => c.column_name === 'length');
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)
.query({
column_name: lengthColumn.column_name,
@ -65,7 +65,7 @@ function groupByTests() {
);
const filterCondition = '(Length,eq,46)';
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)
.query({
column_name: rentalDurationColumn.column_name,
@ -84,7 +84,7 @@ function groupByTests() {
const titleColumn = filmColumns.find((c) => c.column_name === 'title');
const filterCondition = '(Length,eq,46)~and(RentalDuration,eq,5)';
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)
.query({
column_name: titleColumn.column_name,
@ -102,7 +102,7 @@ function groupByTests() {
it('Check One GroupBy Column With Descending', async function () {
const lengthColumn = filmColumns.find((c) => c.column_name === 'length');
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)
.query({
column_name: lengthColumn.column_name,
@ -122,7 +122,7 @@ function groupByTests() {
);
const filterCondition = '(Length,eq,46)';
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)
.query({
column_name: rentalDurationColumn.column_name,
@ -141,7 +141,7 @@ function groupByTests() {
const titleColumn = filmColumns.find((c) => c.column_name === 'title');
const filterCondition = '(Length,eq,46)~and(RentalDuration,eq,5)';
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)
.query({
column_name: titleColumn.column_name,
@ -172,7 +172,7 @@ function groupByTests() {
// Group By Length Column Ascending Order
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)
.send({
group_by: true,
@ -182,7 +182,7 @@ function groupByTests() {
.expect(200);
// Group By RentalDuration Column Descending
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)
.send({
group_by: true,
@ -192,7 +192,7 @@ function groupByTests() {
.expect(200);
const columns = (
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)
.expect(200)
).body.list;
@ -226,7 +226,7 @@ function groupByTests() {
],
});
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)
.query({
column_name: _lengthColumn.column_name,
@ -243,7 +243,7 @@ function groupByTests() {
it('Check One GroupBy Column with Links/Rollup', async function () {
const actorsColumn = filmColumns.find((c) => c.title === 'Actors');
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)
.query({
column_name: actorsColumn.title,
@ -285,7 +285,7 @@ function groupByTests() {
});
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)
.query({
column_name: 'LanguageName',
@ -307,7 +307,7 @@ function groupByTests() {
});
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)
.query({
column_name: 'ActorNames',
@ -326,7 +326,7 @@ function groupByTests() {
});
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)
.query({
column_name: formulaColumnTitle,
@ -349,7 +349,7 @@ function groupByTests() {
});
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)
.query({
column_name: nestedFormulaColumnTitle,

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

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

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

@ -40,7 +40,7 @@ function tableStaticTests() {
it('Get table list', async function () {
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)
.send({})
.expect(200);
@ -50,7 +50,7 @@ function tableStaticTests() {
it('Create table with no table name', async function () {
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)
.send({
table_name: undefined,
@ -79,7 +79,7 @@ function tableStaticTests() {
it('Create table with same table name', async function () {
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)
.send({
table_name: table.table_name,
@ -101,7 +101,7 @@ function tableStaticTests() {
it('Create table with same title', async function () {
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)
.send({
table_name: 'New_table_name',
@ -123,7 +123,7 @@ function tableStaticTests() {
it('Create table with title length more than the limit', async function () {
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)
.send({
table_name: 'a'.repeat(256),
@ -145,7 +145,7 @@ function tableStaticTests() {
it('Create table with title having leading white space', async function () {
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)
.send({
table_name: 'table_name_with_whitespace ',
@ -186,7 +186,7 @@ function tableTest() {
it('Create table', async function () {
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)
.send({
table_name: 'table2',
@ -216,7 +216,7 @@ function tableTest() {
it('Update table', async function () {
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)
.send({
base_id: base.id,
@ -232,7 +232,7 @@ function tableTest() {
it('Delete table', async function () {
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)
.send({})
.expect(200);
@ -249,7 +249,7 @@ function tableTest() {
it('Get table', async function () {
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)
.send({})
.expect(200);
@ -261,7 +261,7 @@ function tableTest() {
it('Reorder table', async function () {
const newOrder = table.order === 0 ? 1 : 0;
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)
.send({
order: newOrder,
@ -282,7 +282,7 @@ function tableTest() {
it('Add and delete view should update hasNonDefaultViews', async () => {
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)
.send({})
.expect(200);
@ -296,7 +296,7 @@ function tableTest() {
});
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)
.send({})
.expect(200);
@ -306,7 +306,7 @@ function tableTest() {
await deleteView(context, { viewId: view.id });
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)
.send({})
.expect(200);
@ -316,7 +316,7 @@ function tableTest() {
it('Project with empty meta should update hasNonDefaultViews', async () => {
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)
.send({})
.expect(200);
@ -337,7 +337,7 @@ function tableTest() {
});
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)
.send({})
.expect(200);
@ -347,7 +347,7 @@ function tableTest() {
await deleteView(context, { viewId: view.id });
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)
.send({})
.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 () {
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)
.send({})
.expect(200);
@ -79,7 +79,7 @@ function tableStaticTest() {
const requiredColumns = customerColumns.filter((_, index) => index < 3);
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)
.query({
fields: requiredColumns.map((c) => c.title),
@ -104,7 +104,7 @@ function tableStaticTest() {
const sortInfo = [{ fk_column_id: firstNameColumn.id, direction: 'desc' }];
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)
.query({
fields: visibleColumns.map((c) => c.title),
@ -131,7 +131,7 @@ function tableStaticTest() {
const lastPageOffset =
Math.trunc(pageInfo.totalRows / pageInfo.pageSize) * pageInfo.pageSize;
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)
.query({
fields: visibleColumns.map((c) => c.title),
@ -157,7 +157,7 @@ function tableStaticTest() {
const sortInfo = [{ fk_column_id: firstNameColumn.id, direction: 'asc' }];
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)
.query({
fields: visibleColumns.map((c) => c.title),
@ -184,7 +184,7 @@ function tableStaticTest() {
const lastPageOffset =
Math.trunc(pageInfo.totalRows / pageInfo.pageSize) * pageInfo.pageSize;
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)
.query({
fields: visibleColumns.map((c) => c.title),
@ -204,7 +204,7 @@ function tableStaticTest() {
});
it('Create table row with wrong table id', async function () {
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)
.send({
title: 'Test',
@ -222,7 +222,7 @@ function tableStaticTest() {
let response = await request(context.app)
.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)
.query({
@ -243,7 +243,7 @@ function tableStaticTest() {
response = await request(context.app)
.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)
.query({
@ -264,7 +264,7 @@ function tableStaticTest() {
});
it('Read table row', async function () {
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)
.expect(200);
@ -272,7 +272,7 @@ function tableStaticTest() {
const readResponse = await request(context.app)
.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)
.expect(200);
@ -292,7 +292,7 @@ function tableStaticTest() {
});
const response = await request(context.app)
.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)
.query({
@ -311,7 +311,7 @@ function tableStaticTest() {
const response = await request(context.app)
.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)
.expect(200);
@ -323,7 +323,7 @@ function tableStaticTest() {
it('Exist should be false table row when it does not exists', async function () {
const response = await request(context.app)
.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)
.expect(200);
@ -336,7 +336,7 @@ function tableStaticTest() {
it('Export csv', async () => {
const response = await request(context.app)
.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)
.expect(200);
@ -354,7 +354,7 @@ function tableStaticTest() {
it('Export excel', async () => {
const response = await request(context.app)
.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)
.expect(200);
@ -378,7 +378,7 @@ function tableStaticTest() {
)!;
const response = await request(context.app)
.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)
.expect(200);
@ -396,7 +396,7 @@ function tableStaticTest() {
)!;
const response = await request(context.app)
.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)
.query({
@ -421,7 +421,7 @@ function tableStaticTest() {
)!;
const response = await request(context.app)
.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)
.expect(404);
@ -442,7 +442,7 @@ function tableStaticTest() {
)!;
const response = await request(context.app)
.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)
.expect(200);
@ -465,7 +465,7 @@ function tableStaticTest() {
)!;
const response = await request(context.app)
.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)
.query({
@ -495,7 +495,7 @@ function tableStaticTest() {
)!;
const response = await request(context.app)
.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)
.expect(404);
@ -513,7 +513,7 @@ function tableStaticTest() {
const refId = 1;
const response = await request(context.app)
.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)
.expect(404);
@ -530,7 +530,7 @@ function tableStaticTest() {
const refId = 1;
const response = await request(context.app)
.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)
.expect(404);
@ -546,7 +546,7 @@ function tableStaticTest() {
const response = await request(context.app)
.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)
.expect(404);
@ -566,7 +566,7 @@ function tableStaticTest() {
await request(context.app)
.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)
.expect(400);
@ -579,7 +579,7 @@ function tableStaticTest() {
await request(context.app)
.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)
.expect(400);
@ -592,7 +592,7 @@ function tableStaticTest() {
const response = await request(context.app)
.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)
.expect(200);
@ -610,7 +610,7 @@ function tableStaticTest() {
const response = await request(context.app)
.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)
.query({
@ -641,7 +641,7 @@ function tableStaticTest() {
const response = await request(context.app)
.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)
.expect(200);
@ -663,7 +663,7 @@ function tableStaticTest() {
const response = await request(context.app)
.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)
.query({
@ -694,7 +694,7 @@ function tableStaticTest() {
const response = await request(context.app)
.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)
.expect(200);
@ -714,7 +714,7 @@ function tableStaticTest() {
const response = await request(context.app)
.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)
.query({
@ -735,7 +735,7 @@ function tableStaticTest() {
const response = await request(context.app)
.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)
.expect(200);
@ -792,7 +792,7 @@ function tableTest() {
});
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)
.query({
sortArrJson: JSON.stringify([
@ -804,7 +804,7 @@ function tableTest() {
throw new Error('Wrong sort');
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)
.query({
sortArrJson: JSON.stringify([
@ -831,7 +831,7 @@ function tableTest() {
});
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)
.query({
sortArrJson: JSON.stringify([
@ -844,7 +844,7 @@ function tableTest() {
throw new Error('Wrong sort');
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)
.query({
sortArrJson: JSON.stringify([
@ -879,7 +879,7 @@ function tableTest() {
};
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)
.query({
filterArrJson: JSON.stringify([filter]),
@ -914,7 +914,7 @@ function tableTest() {
};
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)
.query({
filterArrJson: JSON.stringify([filter]),
@ -957,7 +957,7 @@ function tableTest() {
};
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)
.query({
filterArrJson: JSON.stringify([nestedFilter]),
@ -967,7 +967,7 @@ function tableTest() {
expect(response.body.pageInfo.totalRows).equal(9558);
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)
.query({
filterArrJson: JSON.stringify([nestedFilter]),
@ -984,7 +984,7 @@ function tableTest() {
expect(ascResponse.body.list[0][lookupColumn.title]).equal('AARON');
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)
.query({
filterArrJson: JSON.stringify([nestedFilter]),
@ -1051,7 +1051,7 @@ function tableTest() {
};
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)
.query({
filterArrJson: JSON.stringify([nestedFilter]),
@ -1067,7 +1067,7 @@ function tableTest() {
throw new Error('Wrong filter');
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)
.query({
filterArrJson: JSON.stringify([nestedFilter]),
@ -1091,7 +1091,7 @@ function tableTest() {
}
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)
.query({
filterArrJson: JSON.stringify([nestedFilter]),
@ -1180,7 +1180,7 @@ function tableTest() {
];
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)
.query({
filterArrJson: JSON.stringify([nestedFilter]),
@ -1198,7 +1198,7 @@ function tableTest() {
}
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)
.query({
filterArrJson: JSON.stringify([nestedFilter]),
@ -1234,7 +1234,7 @@ function tableTest() {
}
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)
.query({
filterArrJson: JSON.stringify([nestedFilter]),
@ -1327,7 +1327,7 @@ function tableTest() {
];
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)
.query({
nested: nestedFields,
@ -1383,7 +1383,7 @@ function tableTest() {
});
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)
.query({
sortArrJson: JSON.stringify([
@ -1440,7 +1440,7 @@ function tableTest() {
// console.log(formulaColumn);
// 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)
// .query({
// sortArrJson: JSON.stringify([
@ -1459,7 +1459,7 @@ function tableTest() {
const table = await createTable(context, base);
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)
.send({
title: 'Test',
@ -1489,7 +1489,7 @@ function tableTest() {
const response = await request(context.app)
.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)
.query({
@ -1569,7 +1569,7 @@ function tableTest() {
const ascResponse = await request(context.app)
.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)
.query({
@ -1613,7 +1613,7 @@ function tableTest() {
const response = await request(context.app)
.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)
.query({
@ -1649,7 +1649,7 @@ function tableTest() {
const response = await request(context.app)
.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)
.query({
@ -1672,7 +1672,7 @@ function tableTest() {
const row = await createRow(context, { base, table });
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)
.send({
title: 'Updated',
@ -1697,7 +1697,7 @@ function tableTest() {
const row = await createRow(context, { base, table });
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)
.send({
[emailColumn.column_name]: 'invalidemail',
@ -1721,7 +1721,7 @@ function tableTest() {
const row = await createRow(context, { base, table });
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)
.send({
[emailColumn.column_name]: 'valid@example.com',
@ -1743,7 +1743,7 @@ function tableTest() {
const row = await createRow(context, { base, table });
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)
.expect(200);
@ -1779,7 +1779,7 @@ function tableTest() {
});
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)
.expect(200);
@ -1798,7 +1798,7 @@ function tableTest() {
.map((index) => generateDefaultRowAttributes({ columns, index }));
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)
.send(rowAttributes)
.expect(200);
@ -1835,7 +1835,7 @@ function tableTest() {
.map((index) => generateDefaultRowAttributes({ columns, index }));
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)
.send(rowAttributes)
.expect(200);
@ -1883,7 +1883,7 @@ function tableTest() {
const rows = await listRow({ base, table });
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)
.send(
rows.map((row) => ({ title: `new-${row['Title']}`, id: row['Id'] })),
@ -1912,7 +1912,7 @@ function tableTest() {
const rows = await listRow({ base, table });
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)
.send(rows.map((row) => ({ id: row['Id'] })))
.expect(200);
@ -1939,7 +1939,7 @@ function tableTest() {
// const rows = await listRow({ base, table });
// 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)
// .query({ filterArr: [
// {
@ -1976,7 +1976,7 @@ function tableTest() {
// (column) => column.title === 'Rentals'
// )!;
// 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({
// fields: visibleColumns.map((c) => c.title),
// })
@ -2002,12 +2002,12 @@ function tableTest() {
// const refId = 1;
// 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)
// .expect(400)
// 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)
// .expect(400)
// })
@ -2021,14 +2021,14 @@ function tableTest() {
const lisResponseBeforeUpdate = await request(context.app)
.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)
.expect(200);
await request(context.app)
.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)
.expect(200);
@ -2036,7 +2036,7 @@ function tableTest() {
const lisResponseAfterUpdate = await request(context.app)
.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)
.expect(200);
@ -2059,7 +2059,7 @@ function tableTest() {
const response = await request(context.app)
.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)
.expect(404);
@ -2084,7 +2084,7 @@ function tableTest() {
const refId = 1;
const response = await request(context.app)
.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)
.expect(404);
@ -2108,7 +2108,7 @@ function tableTest() {
await request(context.app)
.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)
.expect(400);
@ -2130,14 +2130,14 @@ function tableTest() {
const lisResponseBeforeUpdate = await request(context.app)
.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)
.expect(200);
await request(context.app)
.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)
.expect(200);
@ -2145,7 +2145,7 @@ function tableTest() {
const lisResponseAfterUpdate = await request(context.app)
.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)
.expect(200);
@ -2171,14 +2171,14 @@ function tableTest() {
const lisResponseBeforeDelete = await request(context.app)
.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)
.expect(200);
await request(context.app)
.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)
.expect(200);
@ -2186,7 +2186,7 @@ function tableTest() {
const lisResponseAfterDelete = await request(context.app)
.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)
.expect(200);
@ -2211,7 +2211,7 @@ function tableTest() {
const response = await request(context.app)
.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)
.expect(400);
@ -2259,7 +2259,7 @@ function tableTest() {
const childRow = (await listRow({ base, table: relatedTable }))[0];
const response = await request(context.app)
.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)
.expect(200);
@ -2286,7 +2286,7 @@ function tableTest() {
const response = await request(context.app)
.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)
.expect(404);
@ -2308,7 +2308,7 @@ function tableTest() {
)!;
const response = await request(context.app)
.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)
.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 response = await request(context.app)
.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)
.expect(200);
@ -72,7 +72,7 @@ const testGetViewRowListKanban = async (view: View) => {
const response = await request(context.app)
.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)
.expect(200);
@ -155,7 +155,7 @@ function viewRowStaticTests() {
const response = await request(context.app)
.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)
.query({
@ -198,7 +198,7 @@ function viewRowStaticTests() {
const response = await request(context.app)
.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)
.query({
@ -230,7 +230,7 @@ function viewRowStaticTests() {
const response = await request(context.app)
.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)
.query({
@ -258,7 +258,7 @@ function viewRowStaticTests() {
Math.trunc(pageInfo.totalRows / pageInfo.pageSize) * pageInfo.pageSize;
const lastPageResponse = await request(context.app)
.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)
.query({
@ -298,7 +298,7 @@ function viewRowStaticTests() {
const response = await request(context.app)
.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)
.query({
@ -329,7 +329,7 @@ function viewRowStaticTests() {
const response = await request(context.app)
.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)
.query({
@ -357,7 +357,7 @@ function viewRowStaticTests() {
Math.trunc(pageInfo.totalRows / pageInfo.pageSize) * pageInfo.pageSize;
const lastPageResponse = await request(context.app)
.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)
.query({
@ -397,7 +397,7 @@ function viewRowStaticTests() {
const response = await request(context.app)
.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)
.query({
@ -498,7 +498,7 @@ function viewRowTests() {
const response = await request(context.app)
.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)
.query({
@ -509,7 +509,7 @@ function viewRowTests() {
const ascResponse = await request(context.app)
.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)
.query({
@ -528,7 +528,7 @@ function viewRowTests() {
const descResponse = await request(context.app)
.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)
.query({
@ -620,7 +620,7 @@ function viewRowTests() {
const ascResponse = await request(context.app)
.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)
.query({
@ -664,7 +664,7 @@ function viewRowTests() {
});
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)
.send({
title: 'Test',
@ -701,7 +701,7 @@ function viewRowTests() {
await request(context.app)
.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)
.send({
@ -743,7 +743,7 @@ function viewRowTests() {
let response = await request(context.app)
.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)
.query({
@ -764,7 +764,7 @@ function viewRowTests() {
response = await request(context.app)
.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)
.query({
@ -867,7 +867,7 @@ function viewRowTests() {
const ascResponse = await request(context.app)
.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)
.query({
@ -929,7 +929,7 @@ function viewRowTests() {
const response = await request(context.app)
.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)
.query({
@ -980,7 +980,7 @@ function viewRowTests() {
const response = await request(context.app)
.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)
.query({
@ -1016,7 +1016,7 @@ function viewRowTests() {
const response = await request(context.app)
.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)
.expect(200);
@ -1040,7 +1040,7 @@ function viewRowTests() {
const listResponse = await request(context.app)
.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)
.expect(200);
@ -1049,7 +1049,7 @@ function viewRowTests() {
const readResponse = await request(context.app)
.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)
.expect(200);
@ -1078,7 +1078,7 @@ function viewRowTests() {
const updateResponse = await request(context.app)
.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)
.send({
@ -1122,7 +1122,7 @@ function viewRowTests() {
await request(context.app)
.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)
.send({
@ -1164,7 +1164,7 @@ function viewRowTests() {
const response = await request(context.app)
.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)
.send({
@ -1202,7 +1202,7 @@ function viewRowTests() {
await request(context.app)
.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)
.expect(200);
@ -1256,7 +1256,7 @@ function viewRowTests() {
await request(context.app)
.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)
.expect(200);
@ -1289,7 +1289,7 @@ function viewRowTests() {
const response = await request(context.app)
.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)
.expect(200);
@ -1312,7 +1312,7 @@ function viewRowTests() {
});
const response = await request(context.app)
.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)
.expect(200);
@ -1335,7 +1335,7 @@ function viewRowTests() {
});
const response = await request(context.app)
.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)
.expect(200);
@ -1359,7 +1359,7 @@ function viewRowTests() {
});
const response = await request(context.app)
.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)
.expect(200);

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

@ -13,7 +13,7 @@ export class AccountAppStorePage extends BasePage {
await this.waitForResponse({
uiAction: () => this.rootPage.goto('/#/account/apps', { waitUntil: 'networkidle' }),
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({
uiAction: submitChangePassword,
httpMethodsToMatch: ['POST'],
requestUrlPathToMatch: 'api/v1/auth/password/change',
requestUrlPathToMatch: 'api/v1/db/auth/password/change',
});
} else {
await submitChangePassword();

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

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

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

@ -113,14 +113,14 @@ export class ExpandedFormPage extends BasePage {
if (waitForRowsData) {
await this.waitForResponse({
uiAction: saveRowAction,
requestUrlPathToMatch: 'api/v1/data/noco/',
requestUrlPathToMatch: 'api/v1/db/data/noco/',
httpMethodsToMatch: ['GET'],
responseJsonMatcher: json => json['pageInfo'],
});
} else {
await this.waitForResponse({
uiAction: saveRowAction,
requestUrlPathToMatch: 'api/v1/data/noco/',
requestUrlPathToMatch: 'api/v1/db/data/noco/',
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.formSubHeading.click();
},
requestUrlPathToMatch: 'api/v1/meta/forms',
requestUrlPathToMatch: '/api/v1/db/meta/forms',
httpMethodsToMatch: ['PATCH'],
});
await this.waitForResponse({
@ -173,7 +173,7 @@ export class FormPage extends BasePage {
await this.formSubHeading.fill(param.subtitle);
await this.formHeading.click();
},
requestUrlPathToMatch: 'api/v1/meta/forms',
requestUrlPathToMatch: '/api/v1/db/meta/forms',
httpMethodsToMatch: ['PATCH'],
});
}
@ -208,7 +208,7 @@ export class FormPage extends BasePage {
const waitForResponse = async (action: () => Promise<any>) =>
await this.waitForResponse({
uiAction: action,
requestUrlPathToMatch: 'api/v1/meta/form-columns',
requestUrlPathToMatch: '/api/v1/db/meta/form-columns',
httpMethodsToMatch: ['PATCH'],
});
@ -272,7 +272,7 @@ export class FormPage extends BasePage {
await this.afterSubmitMsg.click();
await this.afterSubmitMsg.fill(param.message);
},
requestUrlPathToMatch: 'api/v1/meta/forms',
requestUrlPathToMatch: '/api/v1/db/meta/forms',
httpMethodsToMatch: ['PATCH'],
});
}

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

@ -337,7 +337,7 @@ export class ColumnPageObject extends BasePage {
await this.waitForResponse({
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'],
});
@ -347,7 +347,7 @@ export class ColumnPageObject extends BasePage {
async save({ isUpdated }: { isUpdated?: boolean } = {}) {
await this.waitForResponse({
uiAction: async () => await this.get().locator('button:has-text("Save")').click(),
requestUrlPathToMatch: 'api/v1/data/noco/',
requestUrlPathToMatch: 'api/v1/db/data/noco/',
httpMethodsToMatch: ['GET'],
responseJsonMatcher: json => json['pageInfo'],
});

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

@ -134,7 +134,7 @@ export class GridPage extends BasePage {
if (networkValidation) {
await this.waitForResponse({
uiAction: clickOnColumnHeaderToSave,
requestUrlPathToMatch: 'api/v1/data/noco',
requestUrlPathToMatch: 'api/v1/db/data/noco',
httpMethodsToMatch: ['POST'],
// numerical types are returned in number format from the server
responseJsonMatcher: resJson => String(resJson?.[columnHeader]) === String(rowValue),
@ -166,7 +166,7 @@ export class GridPage extends BasePage {
if (networkValidation) {
await this.waitForResponse({
uiAction: clickOnColumnHeaderToSave,
requestUrlPathToMatch: 'api/v1/data/noco',
requestUrlPathToMatch: 'api/v1/db/data/noco',
httpMethodsToMatch: [
'PATCH',
// 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.waitForResponse({
requestUrlPathToMatch: '/api/v1/data/bulk/',
requestUrlPathToMatch: '/api/v1/db/data/bulk/',
httpMethodsToMatch: ['POST'],
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() {
await this.waitForResponse({
uiAction: () => this.get().locator('input[type="checkbox"]').last().click(),
requestUrlPathToMatch: 'api/v1/meta/bases',
requestUrlPathToMatch: '/api/v1/db/meta/projects',
httpMethodsToMatch: ['PATCH'],
});
}

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

@ -108,7 +108,7 @@ export class ShareProjectButtonPage extends BasePage {
await this.waitForResponse({
uiAction: () => this.rootPage.getByTestId('docs-base-share-public-toggle').click(),
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({
uiAction: () => this.dashboard.get().getByTestId('docs-create-proj-dlg-create-btn').click(),
httpMethodsToMatch: ['POST'],
requestUrlPathToMatch: `api/v1/meta/bases/`,
requestUrlPathToMatch: `/api/v1/db/meta/projects/`,
});
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();
await this.waitForResponse({
httpMethodsToMatch: ['POST'],
requestUrlPathToMatch: '/api/v1/meta/tables/',
requestUrlPathToMatch: '/api/v1/db/meta/tables/',
uiAction: submitAction,
responseJsonMatcher: json => json.title === title,
});

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

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

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();
await this.waitForResponse({
httpMethodsToMatch: ['POST'],
requestUrlPathToMatch: '/api/v1/meta/tables/',
requestUrlPathToMatch: '/api/v1/db/meta/tables/',
uiAction: submitAction,
});
// 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({
uiAction: async () => await this.get({ index, columnHeader }).locator('.ant-rate-star > div').nth(rating).click(),
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');
await this.waitForResponse({
uiAction: saveRowAction,
requestUrlPathToMatch: 'api/v1/data/noco/',
requestUrlPathToMatch: 'api/v1/db/data/noco/',
httpMethodsToMatch: ['PATCH'],
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.waitForResponse({
uiAction: () => this.get({ index, columnHeader }).locator('.nc-datatype-link').click(),
requestUrlPathToMatch: '/api/v1/data/noco/',
requestUrlPathToMatch: '/api/v1/db/data/noco',
httpMethodsToMatch: ['GET'],
});
}
@ -371,7 +371,7 @@ export class CellPageObject extends BasePage {
await this.waitForResponse({
uiAction: () =>
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'],
});

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

@ -35,7 +35,7 @@ export class ToolbarFieldsPage extends BasePage {
if (validateResponse) {
await this.waitForResponse({
uiAction: toggleColumn,
requestUrlPathToMatch: isLocallySaved ? '/api/v1/public/' : '/api/v1/data/noco/',
requestUrlPathToMatch: isLocallySaved ? '/api/v1/db/public/' : '/api/v1/db/data/noco/',
httpMethodsToMatch: ['GET'],
});
} else {
@ -59,7 +59,7 @@ export class ToolbarFieldsPage extends BasePage {
async click({ title, isLocallySaved }: { title: string; isLocallySaved?: boolean }) {
await this.waitForResponse({
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'],
});
await this.toolbar.parent.waitLoading();
@ -69,7 +69,7 @@ export class ToolbarFieldsPage extends BasePage {
await this.toolbar.clickFields();
await this.waitForResponse({
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'],
timeout: 10000,
});
@ -80,7 +80,7 @@ export class ToolbarFieldsPage extends BasePage {
// await this.toolbar.clickFields();
// await this.waitForResponse({
// 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'],
// });
// await this.toolbar.clickFields();
@ -90,7 +90,7 @@ export class ToolbarFieldsPage extends BasePage {
await this.toolbar.clickFields();
await this.waitForResponse({
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'],
});
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`)
.click(),
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()
.click(),
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()
.click(),
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 () =>
await this.rootPage.locator(`.ant-picker-cell-inner:has-text("${value}")`).click(),
httpMethodsToMatch: ['GET'],
requestUrlPathToMatch: locallySaved ? `/api/v1/public/` : `/api/v1/data/noco/`,
requestUrlPathToMatch: locallySaved ? `/api/v1/db/public/` : `/api/v1/db/data/noco/`,
});
}
} else {
@ -261,7 +261,7 @@ export class ToolbarFilterPage extends BasePage {
await this.waitForResponse({
uiAction: fillFilter,
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();
@ -277,7 +277,7 @@ export class ToolbarFilterPage extends BasePage {
await this.waitForResponse({
uiAction: async () => await this.get().locator('.nc-filter-value-select').locator('input').fill(value),
httpMethodsToMatch: ['GET'],
requestUrlPathToMatch: locallySaved ? `/api/v1/public/` : `/api/v1/data/noco/`,
requestUrlPathToMatch: locallySaved ? `/api/v1/db/public/` : `/api/v1/db/data/noco/`,
});
}
break;
@ -336,7 +336,7 @@ export class ToolbarFilterPage extends BasePage {
await this.waitForResponse({
uiAction: fillFilter,
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.waitLoading();
@ -351,7 +351,7 @@ export class ToolbarFilterPage extends BasePage {
await this.waitForResponse({
uiAction: async () => await this.get().locator('.nc-filter-item-remove-btn').click(),
httpMethodsToMatch: ['DELETE'],
requestUrlPathToMatch: '/api/v1/meta/filters/',
requestUrlPathToMatch: '/api/v1/db/meta/filters/',
});
} else {
await this.get().locator('.nc-filter-item-remove-btn').click();
@ -367,7 +367,7 @@ export class ToolbarFilterPage extends BasePage {
await this.waitForResponse({
uiAction: async () => await this.get().locator('.nc-filter-item-remove-btn').click(),
httpMethodsToMatch: ['DELETE'],
requestUrlPathToMatch: '/api/v1/meta/filters/',
requestUrlPathToMatch: '/api/v1/db/meta/filters/',
});
} else {
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({
uiAction: selectSortDirection,
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({
uiAction: selectSortDirection,
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();
// close sort menu
@ -119,7 +119,7 @@ export class ToolbarSortPage extends BasePage {
await this.waitForResponse({
uiAction: selectColumn,
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
@ -159,7 +159,7 @@ export class ToolbarSortPage extends BasePage {
await this.waitForResponse({
uiAction: selectSortDirection,
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();
// close sort menu

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

@ -41,7 +41,7 @@ export class ProjectsPage extends BasePage {
await this.waitForResponse({
uiAction: createProjectSubmitAction,
httpMethodsToMatch: ['POST'],
requestUrlPathToMatch: '/api/v1/meta/bases/',
requestUrlPathToMatch: '/api/v1/db/meta/projects/',
});
// wait for dashboard to render
@ -89,7 +89,7 @@ export class ProjectsPage extends BasePage {
await this.waitForResponse({
uiAction: dupeProjectSubmitAction,
httpMethodsToMatch: ['POST'],
requestUrlPathToMatch: 'api/v1/meta/duplicate/',
requestUrlPathToMatch: '/api/v1/db/meta/duplicate/',
});
// wait for duplicate create completed and render kebab
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();
await this.waitForResponse({
uiAction: reloadUiAction,
requestUrlPathToMatch: '/api/v1/meta/bases',
requestUrlPathToMatch: '/api/v1/db/meta/projects',
httpMethodsToMatch: ['GET'],
});
}
@ -145,7 +145,7 @@ export class ProjectsPage extends BasePage {
}
const isRequiredResponse =
res.request().url().includes('/api/v1/meta/bases') &&
res.request().url().includes('/api/v1/db/meta/projects') &&
['GET'].includes(res.request().method()) &&
json?.title === title;
@ -180,7 +180,7 @@ export class ProjectsPage extends BasePage {
await this.waitForResponse({
uiAction: deleteProjectAction,
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' });
@ -212,7 +212,7 @@ export class ProjectsPage extends BasePage {
const submitAction = () => base.locator('input.nc-metadb-base-name').press('Enter');
await this.waitForResponse({
uiAction: submitAction,
requestUrlPathToMatch: 'api/v1/meta/bases/',
requestUrlPathToMatch: '/api/v1/db/meta/projects/',
httpMethodsToMatch: ['PATCH'],
});
}

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

@ -140,7 +140,7 @@ export class ContainerPage extends BasePage {
await this.waitForResponse({
uiAction: () => this.rootPage.locator('.nc-metadb-base-name').press('Enter'),
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({
uiAction: () => row.locator('td.ant-table-cell').nth(0).locator('input').press('Enter'),
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({
uiAction: () => this.rootPage.locator('.ant-modal-content').locator('button:has-text("Delete")').click(),
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 () => {
// 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);
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({
uiAction: async () => await page.keyboard.press(isMac ? 'Meta+z' : 'Control+z'),
httpMethodsToMatch: ['GET'],
requestUrlPathToMatch: `/api/v1/data/noco/`,
requestUrlPathToMatch: `/api/v1/db/data/noco`,
responseJsonMatcher: json => json.pageInfo,
});
} else {
@ -593,7 +593,7 @@ test.describe('Undo Redo - LTAR', () => {
await dashboard.grid.waitForResponse({
uiAction: async () => await page.keyboard.press(isMac ? 'Meta+z' : 'Control+z'),
httpMethodsToMatch: ['GET'],
requestUrlPathToMatch: `/api/v1/data/noco/`,
requestUrlPathToMatch: `/api/v1/db/data/noco`,
responseJsonMatcher: json => json.pageInfo,
});
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({
uiAction: () => page.keyboard.press(isMac ? 'Meta+z' : 'Control+z'),
httpMethodsToMatch: ['GET'],
requestUrlPathToMatch: `/api/v1/data/noco/`,
requestUrlPathToMatch: `/api/v1/db/data/noco/`,
responseJsonMatcher: json => json.pageInfo,
});
} else {

Loading…
Cancel
Save