chore: Typescript database models (#2886)

closes #2798
This commit is contained in:
Tom Moor
2022-01-06 18:24:28 -08:00
committed by GitHub
parent d3cbf250e6
commit b20a341f0c
207 changed files with 5624 additions and 5315 deletions

View File

@@ -2,7 +2,9 @@ import fs from "fs";
import JSZip from "jszip";
import tmp from "tmp";
import Logger from "@server/logging/logger";
import { Attachment, Collection, Document } from "@server/models";
import Attachment from "@server/models/Attachment";
import Collection from "@server/models/Collection";
import Document from "@server/models/Document";
import { NavigationNode } from "~/types";
import { serializeFilename } from "./fs";
import { getFileByKey } from "./s3";
@@ -31,7 +33,6 @@ async function addToArchive(zip: JSZip, documents: NavigationNode[]) {
zip.file(`${title}.md`, text, {
date: document.updatedAt,
comment: JSON.stringify({
pinned: document.pinned,
createdAt: document.createdAt,
updatedAt: document.updatedAt,
}),
@@ -84,7 +85,6 @@ async function archiveToPath(zip: JSZip) {
});
}
// @ts-expect-error ts-migrate(2749) FIXME: 'Collection' refers to a value, but is being used ... Remove this comment to see the full error message
export async function archiveCollections(collections: Collection[]) {
const zip = new JSZip();