diff --git a/packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue b/packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue index 3d9f3a5818..49bb750e80 100644 --- a/packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue +++ b/packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue @@ -514,7 +514,7 @@ const projectDelete = () => { @click.stop=" () => { $e('c:base:api-docs') - openLink(`/api/v1/db/meta/bases/${base.id}/swagger`, appInfo.ncSiteUrl) + openLink(`/api/v1/db/meta/projects/${base.id}/swagger`, appInfo.ncSiteUrl) } " > diff --git a/packages/nc-gui/components/dlg/AirtableImport.vue b/packages/nc-gui/components/dlg/AirtableImport.vue index d7381cf2bd..769f776db2 100644 --- a/packages/nc-gui/components/dlg/AirtableImport.vue +++ b/packages/nc-gui/components/dlg/AirtableImport.vue @@ -132,7 +132,7 @@ async function createOrUpdate() { body: payload, }) } else { - syncSource.value = await $fetch(`/api/v1/db/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/db/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 }, diff --git a/packages/nc-gui/components/general/HelpAndSupport.vue b/packages/nc-gui/components/general/HelpAndSupport.vue index 3fab2b6dd4..3e79d20485 100644 --- a/packages/nc-gui/components/general/HelpAndSupport.vue +++ b/packages/nc-gui/components/general/HelpAndSupport.vue @@ -10,7 +10,7 @@ const { base } = storeToRefs(useBase()) const route = useRoute() const openSwaggerLink = () => { - openLink(`./api/v1/db/meta/bases/${route.params.baseId}/swagger`, appInfo.value.ncSiteUrl) + openLink(`./api/v1/db/meta/projects/${route.params.baseId}/swagger`, appInfo.value.ncSiteUrl) } diff --git a/packages/nocodb/src/models/Base.ts b/packages/nocodb/src/models/Base.ts index eb4363d7c9..7b49609537 100644 --- a/packages/nocodb/src/models/Base.ts +++ b/packages/nocodb/src/models/Base.ts @@ -387,7 +387,7 @@ export default class Base implements BaseType { return baseData?.id && this.get(baseData?.id, ncMeta); } - static async getByTitleOrId(titleOrId: string, ncMeta = Noco.ncMeta) { + static async getByTitleOrId(titleOrId: string, ncMeta = Noco.ncMeta) { const baseId = titleOrId && (await NocoCache.get( diff --git a/packages/nocodb/tests/unit/factory/table.ts b/packages/nocodb/tests/unit/factory/table.ts index 5d8040530d..9ccd7232ba 100644 --- a/packages/nocodb/tests/unit/factory/table.ts +++ b/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/db/meta/bases/${base.id}/tables`) + .post(`/api/v1/db/meta/projects/${base.id}/tables`) .set('xc-auth', context.token) .send({ ...defaultValue, ...args }); diff --git a/packages/nocodb/tests/unit/rest/tests/attachment.test.ts b/packages/nocodb/tests/unit/rest/tests/attachment.test.ts index 9d816afe09..e73af3b96b 100644 --- a/packages/nocodb/tests/unit/rest/tests/attachment.test.ts +++ b/packages/nocodb/tests/unit/rest/tests/attachment.test.ts @@ -134,7 +134,7 @@ function attachmentTests() { // invite user to base with editor role await request(context.app) - .post(`/api/v1/db/meta/bases/${newProject.id}/users`) + .post(`/api/v1/db/meta/projects/${newProject.id}/users`) .set('xc-auth', context.token) .send({ roles: ProjectRoles.EDITOR, diff --git a/packages/nocodb/tests/unit/rest/tests/table.test.ts b/packages/nocodb/tests/unit/rest/tests/table.test.ts index f8692c662d..76cc042ff1 100644 --- a/packages/nocodb/tests/unit/rest/tests/table.test.ts +++ b/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/db/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/db/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/db/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/db/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/db/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/db/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/db/meta/bases/${base.id}/tables`) + .post(`/api/v1/db/meta/projects/${base.id}/tables`) .set('xc-auth', context.token) .send({ table_name: 'table2', @@ -282,7 +282,7 @@ function tableTest() { it('Add and delete view should update hasNonDefaultViews', async () => { let response = await request(context.app) - .get(`/api/v1/db/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/db/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/db/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/db/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/db/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/db/meta/bases/${base.id}/tables`) + .get(`/api/v1/db/meta/projects/${base.id}/tables`) .set('xc-auth', context.token) .send({}) .expect(200); diff --git a/tests/playwright/pages/Dashboard/Settings/Miscellaneous.ts b/tests/playwright/pages/Dashboard/Settings/Miscellaneous.ts index 25491a46fe..7896a36e9a 100644 --- a/tests/playwright/pages/Dashboard/Settings/Miscellaneous.ts +++ b/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/db/meta/bases', + requestUrlPathToMatch: '/api/v1/db/meta/projects', httpMethodsToMatch: ['PATCH'], }); } diff --git a/tests/playwright/pages/Dashboard/ShareProjectButton/index.ts b/tests/playwright/pages/Dashboard/ShareProjectButton/index.ts index 9045788dfa..8a5c2d1e85 100644 --- a/tests/playwright/pages/Dashboard/ShareProjectButton/index.ts +++ b/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/db/meta/bases`, + requestUrlPathToMatch: `//api/v1/db/meta/projects`, }); } diff --git a/tests/playwright/pages/Dashboard/Sidebar/index.ts b/tests/playwright/pages/Dashboard/Sidebar/index.ts index e19ec8aad8..27b5da4000 100644 --- a/tests/playwright/pages/Dashboard/Sidebar/index.ts +++ b/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/db/meta/bases/`, + requestUrlPathToMatch: `/api/v1/db/meta/projects/`, }); if (type === ProjectTypes.DOCUMENTATION) { diff --git a/tests/playwright/pages/Dashboard/TreeView.ts b/tests/playwright/pages/Dashboard/TreeView.ts index 5d0575befb..b975052863 100644 --- a/tests/playwright/pages/Dashboard/TreeView.ts +++ b/tests/playwright/pages/Dashboard/TreeView.ts @@ -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/db/meta/bases/`, + requestUrlPathToMatch: `/api/v1/db/meta/projects/`, responseJsonMatcher: json => json.title === title && json.type === 'table', }); diff --git a/tests/playwright/pages/ProjectsPage/index.ts b/tests/playwright/pages/ProjectsPage/index.ts index c840ea5a02..ad479062f6 100644 --- a/tests/playwright/pages/ProjectsPage/index.ts +++ b/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/db/meta/bases/', + requestUrlPathToMatch: '/api/v1/db/meta/projects/', }); // wait for dashboard to render @@ -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/db/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/db/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/db/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/db/meta/bases/', + requestUrlPathToMatch: '/api/v1/db/meta/projects/', httpMethodsToMatch: ['PATCH'], }); } diff --git a/tests/playwright/pages/WorkspacePage/ContainerPage.ts b/tests/playwright/pages/WorkspacePage/ContainerPage.ts index c126df8c5c..9ee3c664a5 100644 --- a/tests/playwright/pages/WorkspacePage/ContainerPage.ts +++ b/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/db/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/db/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/db/meta/bases/`, + requestUrlPathToMatch: `/api/v1/db/meta/projects/`, }); } diff --git a/tests/playwright/tests/db/features/swagger.spec.ts b/tests/playwright/tests/db/features/swagger.spec.ts index cf864b7d9c..3da2f4697b 100644 --- a/tests/playwright/tests/db/features/swagger.spec.ts +++ b/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/db/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;