mirror of
https://github.com/zadam/trilium.git
synced 2026-03-27 14:20:13 +01:00
chore(core): fix various type errors
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { NoteParams } from "@triliumnext/core";
|
||||
import { NoteParams, SearchParams } from "@triliumnext/core";
|
||||
import type { Request, Router } from "express";
|
||||
import type { ParsedQs } from "qs";
|
||||
|
||||
@@ -9,7 +9,6 @@ import zipImportService from "../services/import/zip.js";
|
||||
import noteService from "../services/notes.js";
|
||||
import SearchContext from "../services/search/search_context.js";
|
||||
import searchService from "../services/search/services/search.js";
|
||||
import type { SearchParams } from "../services/search/services/types.js";
|
||||
import TaskContext from "../services/task_context.js";
|
||||
import utils from "../services/utils.js";
|
||||
import eu from "./etapi_utils.js";
|
||||
|
||||
@@ -78,6 +78,7 @@ export type { NotePojo } from "./becca/becca-interface";
|
||||
export { default as NoteSet } from "./services/search/note_set";
|
||||
export { default as SearchContext } from "./services/search/search_context";
|
||||
export { default as search } from "./services/search/services/search";
|
||||
export { type SearchParams } from "./services/search/services/types";
|
||||
export { default as note_service } from "./services/notes";
|
||||
export type { NoteParams } from "./services/notes";
|
||||
export * as sanitize from "./services/sanitizer";
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import cls from "./cls.js";
|
||||
import { getContext } from "./context.js";
|
||||
|
||||
describe("Migration", () => {
|
||||
it("migrates from v214", async () => {
|
||||
await new Promise<void>((resolve) => {
|
||||
cls.init(async () => {
|
||||
await import("../app.js");
|
||||
|
||||
const sql = (await (import("./sql.js"))).default;
|
||||
sql.rebuildIntegrationTestDatabase("spec/db/document_v214.db");
|
||||
getContext().init(async () => {
|
||||
const { getSql, rebuildIntegrationTestDatabase } = (await (import("./sql/index.js")));
|
||||
rebuildIntegrationTestDatabase("spec/db/document_v214.db");
|
||||
|
||||
const migration = (await import("./migration.js")).default;
|
||||
await migration.migrateIfNecessary();
|
||||
expect(sql.getValue("SELECT count(*) FROM blobs")).toBe(118);
|
||||
expect(getSql().getValue("SELECT count(*) FROM blobs")).toBe(118);
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -13,3 +13,7 @@ export function getSql(): SqlService {
|
||||
if (!sql) throw new Error("SQL not initialized");
|
||||
return sql;
|
||||
}
|
||||
|
||||
export function rebuildIntegrationTestDatabase(path: string) {
|
||||
throw new Error("Not implemented");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user