mirror of
https://github.com/outline/outline.git
synced 2026-11-28 08:14:58 +03:00
* wip * Route document list queries through findAllWithCtx Add findAllWithCtx and countWithCtx on Document and Template, unsafe* methods for system reads, and a lint rule that bans direct list queries. Remove the cached membership list, accessibleSql and findByIds in favour of one gate. * Remove test * Include drafts when loading starred documents * Scope the access gate to the user's team, move whereToSql to QueryHelper * Move collection access to Collection.findAllWithCtx Collection.accessibleIds keeps the cached id list inside the collection gate, and user.collectionIds() is a shortcut to it. List queries use findAllWithCtx and countWithCtx, system reads use the shared unsafe methods, and the admin listing in collections.list is explicit. * Check permanentDelete for each document in empty_trash
34 lines
971 B
TypeScript
34 lines
971 B
TypeScript
import type { NavigationNode } from "@shared/types";
|
|
import { FileOperationFormat } from "@shared/types";
|
|
import type { Collection, FileOperation, User } from "@server/models";
|
|
import type { Document } from "@server/models";
|
|
import ExportDocumentTreeTask from "./ExportDocumentTreeTask";
|
|
|
|
export default class ExportOKFZipTask extends ExportDocumentTreeTask {
|
|
public async exportCollections(
|
|
collections: Collection[],
|
|
fileOperation: FileOperation,
|
|
user: User
|
|
) {
|
|
return await this.addCollectionsToArchive(
|
|
collections,
|
|
user,
|
|
FileOperationFormat.OKFZip,
|
|
fileOperation.options?.includeAttachments
|
|
);
|
|
}
|
|
|
|
public async exportDocument(
|
|
document: Document,
|
|
documentStructure: NavigationNode[],
|
|
includeAttachments: boolean
|
|
): Promise<string> {
|
|
return await this.addDocumentToArchive({
|
|
document,
|
|
documentStructure,
|
|
format: FileOperationFormat.OKFZip,
|
|
includeAttachments,
|
|
});
|
|
}
|
|
}
|