Files
outline/server/queues/tasks/ExportHTMLZipTask.ts
Tom MoorandClaude Opus 4.8 8ea04c3bd4 fix: Skip attachment work in exports when includeAttachments is false (#12933)
Gate the workspace attachment-size query behind includeAttachments so it
no longer runs when attachments are excluded, and thread includeAttachments
through the single-document export path (previously hardcoded to true).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 10:20:18 +02:00

39 lines
1.0 KiB
TypeScript

import { ZipFile } from "yazl";
import type { NavigationNode } from "@shared/types";
import { FileOperationFormat } from "@shared/types";
import type { Collection, FileOperation } from "@server/models";
import type { Document } from "@server/models";
import ExportDocumentTreeTask from "./ExportDocumentTreeTask";
export default class ExportHTMLZipTask extends ExportDocumentTreeTask {
public async exportCollections(
collections: Collection[],
fileOperation: FileOperation
) {
const zip = new ZipFile();
return await this.addCollectionsToArchive(
zip,
collections,
FileOperationFormat.HTMLZip,
fileOperation.options?.includeAttachments ?? true
);
}
public async exportDocument(
document: Document,
documentStructure: NavigationNode[],
includeAttachments: boolean
): Promise<string> {
const zip = new ZipFile();
return await this.addDocumentToArchive({
document,
documentStructure,
format: FileOperationFormat.HTMLZip,
zip,
includeAttachments,
});
}
}