refactor(import): remove non-functional DOCX/PDF/Confluence import stubs
These import paths relied on the private EE module that was deleted from the repo. In the community build they either threw 'enterprise license' (DOCX/PDF) or silently no-op'd (Confluence). The frontend buttons were already removed in 38064064; this cleans up the dead backend stubs. - import.service.ts: drop processDocx/processPdf methods, their dispatcher branches, the pageId computation + insertPage spread, and the now-unused moduleRef param/ModuleRef import - file-import-task.service.ts: drop the Confluence branch and the now-unused moduleRef param/ModuleRef import - import.controller.ts: restrict file extensions to .md/.html and zip sources to generic/notion; update the error message accordingly - file.utils.ts: remove Confluence from the FileImportSource enum - features.ts: remove the unused CONFLUENCE_IMPORT/DOCX_IMPORT/PDF_IMPORT feature keys The isConfluenceImport logic in import-attachment.service.ts is intentionally left in place (real shared attachment-parsing code, not a stub); its removal is a separate, riskier refactor.
This commit is contained in:
@@ -51,7 +51,7 @@ export class ImportController {
|
||||
@AuthUser() user: User,
|
||||
@AuthWorkspace() workspace: Workspace,
|
||||
) {
|
||||
const validFileExtensions = ['.md', '.html', '.docx', '.pdf'];
|
||||
const validFileExtensions = ['.md', '.html'];
|
||||
|
||||
const maxFileSize = bytes('30mb');
|
||||
|
||||
@@ -101,8 +101,6 @@ export class ImportController {
|
||||
const sourceMap: Record<string, string> = {
|
||||
'.md': 'markdown',
|
||||
'.html': 'html',
|
||||
'.docx': 'docx',
|
||||
'.pdf': 'pdf',
|
||||
};
|
||||
|
||||
if (createdPage) {
|
||||
@@ -161,10 +159,10 @@ export class ImportController {
|
||||
const spaceId = file.fields?.spaceId?.value;
|
||||
const source = file.fields?.source?.value;
|
||||
|
||||
const validZipSources = ['generic', 'notion', 'confluence'];
|
||||
const validZipSources = ['generic', 'notion'];
|
||||
if (!validZipSources.includes(source)) {
|
||||
throw new BadRequestException(
|
||||
'Invalid import source. Import source must either be generic, notion or confluence.',
|
||||
'Invalid import source. Import source must either be generic or notion.',
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user