mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-25 05:26:08 +00:00
feat: move table api to internal
Signed-off-by: mertmit <mertmit99@gmail.com>
This commit is contained in:
87
APIs.json
Normal file
87
APIs.json
Normal file
@@ -0,0 +1,87 @@
|
||||
[
|
||||
"/api/v1/db/meta/tables/{tableId}",
|
||||
"/api/v1/db/internal/links/{linkColumnId}/tables/{tableId}",
|
||||
"/api/v2/meta/duplicate/{workspaceId}/shared/{sharedBaseId}",
|
||||
"/api/v1/db/meta/tables/{tableId}/reorder",
|
||||
"/api/v1/db/meta/tables/{tableId}/columns",
|
||||
"/api/v1/db/meta/columns/{columnId}",
|
||||
"/api/v1/db/meta/columns/{columnId}/primary",
|
||||
"/api/v1/db/meta/tables/{tableId}/views",
|
||||
"/api/v1/db/meta/views/{viewId}",
|
||||
"/api/v1/db/meta/views/{viewId}/row-color",
|
||||
"/api/v1/db/meta/views/{viewId}/row-color-select",
|
||||
"/api/v1/db/meta/views/{viewId}/row-color-conditions",
|
||||
"/api/v1/db/meta/views/{viewId}/row-color-conditions/{id}",
|
||||
"/api/v1/db/meta/views/{viewId}/show-all",
|
||||
"/api/v1/db/meta/views/{viewId}/hide-all",
|
||||
"/api/v1/db/meta/tables/{tableId}/share",
|
||||
"/api/v1/db/meta/views/{viewId}/share",
|
||||
"/api/v1/db/meta/views/{viewId}/columns",
|
||||
"/api/v1/db/meta/views/{viewId}/columns/{columnId}",
|
||||
"/api/v1/db/meta/views/{viewId}/sorts",
|
||||
"/api/v1/db/meta/sorts/{sortId}",
|
||||
"/api/v1/db/meta/views/{viewId}/filters",
|
||||
"/api/v1/db/meta/hooks/{hookId}/filters",
|
||||
"/api/v1/db/meta/hooks/{hookId}/logs",
|
||||
"/api/v1/db/meta/filters/{filterId}",
|
||||
"/api/v1/db/meta/filters/{filterGroupId}/children",
|
||||
"/api/v1/db/meta/tables/{tableId}/grids",
|
||||
"/api/v1/db/meta/tables/{tableId}/forms",
|
||||
"/api/v1/db/meta/forms/{formViewId}",
|
||||
"/api/v1/db/meta/form-columns/{formViewColumnId}",
|
||||
"/api/v1/db/meta/grids/{viewId}",
|
||||
"/api/v1/db/meta/grids/{gridId}/grid-columns",
|
||||
"/api/v1/db/meta/grid-columns/{columnId}",
|
||||
"/api/v1/db/meta/tables/{tableId}/galleries",
|
||||
"/api/v1/db/meta/galleries/{galleryViewId}",
|
||||
"/api/v1/db/meta/tables/{tableId}/kanbans",
|
||||
"/api/v1/db/meta/kanbans/{kanbanViewId}",
|
||||
"/api/v1/db/meta/tables/{tableId}/maps",
|
||||
"/api/v1/db/meta/maps/{mapViewId}",
|
||||
"/api/v1/db/meta/tables/{tableId}/calendars",
|
||||
"/api/v1/db/meta/calendars/{calendarViewId}",
|
||||
"/api/v1/db/public/calendar-view/{sharedViewUuid}",
|
||||
"/api/v1/db/public/calendar-view/{sharedViewUuid}/countByDate",
|
||||
"/api/v2/tables/{tableId}/bulk/dataList",
|
||||
"/api/v2/tables/{tableId}/bulk/group",
|
||||
"/api/v2/public/shared-view/{sharedViewUuid}/count",
|
||||
"/api/v2/public/shared-view/{sharedViewUuid}/bulk/dataList",
|
||||
"/api/v2/public/shared-view/{sharedViewUuid}/bulk/group",
|
||||
"/api/v2/public/shared-view/{sharedViewUuid}/aggregate",
|
||||
"/api/v2/public/shared-view/{sharedViewUuid}/downloadAttachment/{columnId}/{rowId}",
|
||||
"/api/v1/db/public/shared-view/{sharedViewUuid}/group/{columnId}",
|
||||
"/api/v1/db/public/shared-view/{sharedViewUuid}/rows",
|
||||
"/api/v1/db/public/shared-view/{sharedViewUuid}/groupby",
|
||||
"/api/v2/public/shared-view/{sharedViewUuid}/groupby/count",
|
||||
"/api/v1/db/public/shared-view/{sharedViewUuid}/rows/{rowId}/{relationType}/{columnName}",
|
||||
"/api/v1/db/public/shared-view/{sharedViewUuid}/nested/{columnName}",
|
||||
"/api/v1/db/public/shared-base/{sharedBaseUuid}/meta",
|
||||
"/api/v1/db/public/shared-view/{sharedViewUuid}/meta",
|
||||
"/api/v1/db/public/shared-erd/{sharedErdUuid}/meta",
|
||||
"/api/v1/db/meta/comments",
|
||||
"/api/v1/db/meta/comment/{commentId}/",
|
||||
"/api/v1/db/meta/comments/count",
|
||||
"/api/v1/db/meta/tables/{tableId}/hooks",
|
||||
"/api/v1/db/meta/tables/{tableId}/hooks/test",
|
||||
"/api/v1/db/meta/tables/{tableId}/hooks/samplePayload/{operation}/{version}",
|
||||
"/api/v1/db/meta/hooks/{hookId}",
|
||||
"/api/v1/db/meta/tables/{tableId}/columns/hash",
|
||||
"/api/v1/db/meta/tables/{tableId}/columns/bulk",
|
||||
"/api/v2/tables/{tableId}/aggregate",
|
||||
"/api/v2/tables/{tableId}/records",
|
||||
"/api/v2/tables/{tableId}/records/{rowId}",
|
||||
"/api/v2/tables/{tableId}/records/{rowId}/move",
|
||||
"/api/v2/tables/{tableId}/records/count",
|
||||
"/api/v2/tables/{tableId}/links/{columnId}/records/{rowId}",
|
||||
"/api/v2/downloadAttachment/{modelId}/{columnId}/{rowId}",
|
||||
"/api/v2/tables/{tableId}/links/{columnId}/records",
|
||||
"/api/v2/extensions/{extensionId}",
|
||||
"/api/v2/export/{viewId}/{exportAs}",
|
||||
"/api/v2/public/export/{publicDataUuid}/{exportAs}",
|
||||
"/api/v2/meta/hooks/{hookId}/trigger/{rowId}",
|
||||
"/api/v2/ai/workspaces/{workspaceId}/bases",
|
||||
"/api/v2/ai/tables/{modelId}/rows/generate",
|
||||
"/api/v2/ai/tables/{modelId}/rows/fill",
|
||||
"/api/v2/ai/tables/{modelId}/extract",
|
||||
"/api/v2/tables/:tableId/button/:fieldId"
|
||||
]
|
||||
@@ -209,7 +209,10 @@ async function handleTableRename(
|
||||
})
|
||||
|
||||
// update metas
|
||||
const newMeta = await $api.dbTable.read(table.id as string)
|
||||
const newMeta = await $api.internal.getOperation(activeWorkspaceId.value!, activeProjectId.value!, {
|
||||
operation: 'tableGet',
|
||||
tableId: table.id as string,
|
||||
})
|
||||
await setMeta(newMeta)
|
||||
refreshCommandPalette()
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ const { createProject: _createProject, updateProject } = basesStore
|
||||
|
||||
const { bases, basesList, activeProjectId } = storeToRefs(basesStore)
|
||||
|
||||
const { isWorkspaceLoading } = storeToRefs(useWorkspace())
|
||||
const { activeWorkspaceId, isWorkspaceLoading } = storeToRefs(useWorkspace())
|
||||
|
||||
const baseCreateDlg = ref(false)
|
||||
|
||||
@@ -154,7 +154,10 @@ async function handleTableRename(
|
||||
})
|
||||
|
||||
// update metas
|
||||
const newMeta = await $api.dbTable.read(table.id as string)
|
||||
const newMeta = await $api.internal.getOperation(activeWorkspaceId.value!, base.value.id!, {
|
||||
operation: 'tableGet',
|
||||
tableId: table.id as string,
|
||||
})
|
||||
await setMeta(newMeta)
|
||||
|
||||
refreshCommandPalette()
|
||||
|
||||
@@ -108,7 +108,10 @@ const updateDescription = async (undo = false) => {
|
||||
await loadTables()
|
||||
|
||||
// update metas
|
||||
const newMeta = await $api.dbTable.read(tableMeta.id as string)
|
||||
const newMeta = await $api.internal.getOperation(tableMeta.fk_workspace_id!, tableMeta.base_id!, {
|
||||
operation: 'tableGet',
|
||||
tableId: tableMeta.id as string,
|
||||
})
|
||||
await setMeta(newMeta)
|
||||
|
||||
$e('a:table:description:update')
|
||||
|
||||
@@ -96,7 +96,10 @@ export const useMetas = createSharedComposable(() => {
|
||||
const modelId =
|
||||
(tables.find((t) => t.id === tableIdOrTitle) || tables.find((t) => t.title === tableIdOrTitle))?.id || tableIdOrTitle
|
||||
|
||||
const model = await $api.dbTable.read(modelId)
|
||||
const model = await $api.internal.getOperation(activeWorkspaceId.value!, activeProjectId.value!, {
|
||||
operation: 'tableGet',
|
||||
tableId: modelId,
|
||||
})
|
||||
metas.value = {
|
||||
...metas.value,
|
||||
[model.id!]: model,
|
||||
|
||||
@@ -257,7 +257,10 @@ async function handleTableRename(
|
||||
})
|
||||
|
||||
// update metas
|
||||
const newMeta = await $api.dbTable.read(table.id as string)
|
||||
const newMeta = await $api.internal.getOperation(activeWorkspaceId.value!, activeProjectId.value!, {
|
||||
operation: 'tableGet',
|
||||
tableId: table.id as string,
|
||||
})
|
||||
await setMeta(newMeta)
|
||||
|
||||
refreshCommandPalette()
|
||||
|
||||
@@ -11,7 +11,7 @@ const router = useRouter()
|
||||
|
||||
const route = router.currentRoute
|
||||
|
||||
const { isWorkspaceLoading } = storeToRefs(useWorkspace())
|
||||
const { activeWorkspaceId, isWorkspaceLoading } = storeToRefs(useWorkspace())
|
||||
|
||||
const basesStore = useBases()
|
||||
|
||||
@@ -159,7 +159,10 @@ async function handleTableRename(
|
||||
})
|
||||
|
||||
// update metas
|
||||
const newMeta = await $api.dbTable.read(table.id as string)
|
||||
const newMeta = await $api.internal.getOperation(activeWorkspaceId.value!, base.value.id!, {
|
||||
operation: 'tableGet',
|
||||
tableId: table.id as string,
|
||||
})
|
||||
await setMeta(newMeta)
|
||||
|
||||
refreshCommandPalette()
|
||||
|
||||
@@ -194,7 +194,10 @@ export const useTablesStore = defineStore('tablesStore', () => {
|
||||
}
|
||||
|
||||
// update metas
|
||||
const newMeta = await $api.dbTable.read(table.id as string)
|
||||
const newMeta = await $api.internal.getOperation(table.fk_workspace_id!, table.base_id!, {
|
||||
operation: 'tableGet',
|
||||
tableId: table.id as string,
|
||||
})
|
||||
baseTables.value.set(
|
||||
table.base_id!,
|
||||
baseTables.value.get(table.base_id!)!.map((t) => (t.id === table.id ? { ...t, ...newMeta } : t)),
|
||||
@@ -212,7 +215,10 @@ export const useTablesStore = defineStore('tablesStore', () => {
|
||||
|
||||
const loadTableMeta = async (tableId: string) => {
|
||||
try {
|
||||
const meta = await $api.dbTable.read(tableId as string)
|
||||
const meta = await $api.internal.getOperation(workspaceStore.activeWorkspaceId!, basesStore.activeProjectId!, {
|
||||
operation: 'tableGet',
|
||||
tableId,
|
||||
})
|
||||
baseTables.value.set(
|
||||
meta.base_id!,
|
||||
baseTables.value.get(meta.base_id!)!.map((t) => (t.id === tableId ? { ...t, ...meta } : t)),
|
||||
|
||||
@@ -36,6 +36,7 @@ import { PermissionsService } from '~/services/permissions.service';
|
||||
import { getLimit, PlanLimitTypes } from '~/helpers/paymentHelpers';
|
||||
import { ActionsService } from '~/services/actions.service';
|
||||
import { MailService } from '~/services/mail/mail.service';
|
||||
import { TablesService } from '~/services/tables.service';
|
||||
import { ViewSettingsOverrideService } from '~/services/view-settings-override.service';
|
||||
import { OauthClientService } from '~/modules/oauth/services/oauth-client.service';
|
||||
import { OauthTokenService } from '~/modules/oauth/services/oauth-token.service';
|
||||
@@ -54,6 +55,8 @@ export class InternalController extends InternalControllerCE {
|
||||
protected readonly internalApiModules: InternalApiModule<any>[],
|
||||
protected readonly mcpService: McpTokenService,
|
||||
protected readonly auditsService: AuditsService,
|
||||
protected readonly tablesService: TablesService,
|
||||
|
||||
private readonly dataReflectionService: DataReflectionService,
|
||||
private readonly remoteImportService: RemoteImportService,
|
||||
private readonly syncService: SyncModuleService,
|
||||
@@ -166,6 +169,11 @@ export class InternalController extends InternalControllerCE {
|
||||
req.query.widgetId as string,
|
||||
req,
|
||||
);
|
||||
case 'tableGet':
|
||||
return await this.tablesService.getTableWithAccessibleViews(context, {
|
||||
tableId: req.query.tableId,
|
||||
user: req.user,
|
||||
});
|
||||
case 'teamList':
|
||||
return await this.teamsV3Service.teamList(context, {
|
||||
workspaceOrOrgId: workspaceId,
|
||||
|
||||
Reference in New Issue
Block a user