mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 19:36:12 +01:00
Compare commits
29 Commits
feat/ui-im
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d259aab9d | ||
|
|
5171675dee | ||
|
|
6bc54892a3 | ||
|
|
0a6670ce5e | ||
|
|
beb7c66ff5 | ||
|
|
966e5a2ef3 | ||
|
|
4f5be54030 | ||
|
|
68c6260e45 | ||
|
|
85bfd49d1c | ||
|
|
3ac248169f | ||
|
|
15e240ac33 | ||
|
|
d30fc09e73 | ||
|
|
6a2b9b748f | ||
|
|
b5e2187c0d | ||
|
|
d9a349a531 | ||
|
|
2c1cebfbc3 | ||
|
|
c6738ac52f | ||
|
|
604f2abf5a | ||
|
|
617703899f | ||
|
|
6322ca11c9 | ||
|
|
d62aecc551 | ||
|
|
953b376ce3 | ||
|
|
80f1707d8b | ||
|
|
4f9f8652e2 | ||
|
|
6e06d7169f | ||
|
|
ecf12a4063 | ||
|
|
64428ae761 | ||
|
|
3524c34ff9 | ||
|
|
3f99c8b337 |
@@ -48,9 +48,7 @@
|
||||
"lorem-ipsum": "2.0.8",
|
||||
"rcedit": "4.0.1",
|
||||
"rimraf": "6.1.0",
|
||||
"tslib": "2.8.1",
|
||||
"typedoc": "0.28.14",
|
||||
"typedoc-plugin-missing-exports": "4.1.2"
|
||||
"tslib": "2.8.1"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"appdmg": "0.6.6"
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"entryPoints": [
|
||||
"src/services/backend_script_entrypoint.ts",
|
||||
"src/public/app/services/frontend_script_entrypoint.ts"
|
||||
],
|
||||
"plugin": [
|
||||
"typedoc-plugin-missing-exports"
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "html",
|
||||
"path": "./docs/Script API"
|
||||
}
|
||||
]
|
||||
}
|
||||
22
apps/build-docs/package.json
Normal file
22
apps/build-docs/package.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "build-docs",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "src/main.ts",
|
||||
"scripts": {
|
||||
"start": "tsx ."
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "Elian Doran <contact@eliandoran.me>",
|
||||
"license": "AGPL-3.0-only",
|
||||
"packageManager": "pnpm@10.19.0",
|
||||
"devDependencies": {
|
||||
"@redocly/cli": "2.10.0",
|
||||
"archiver": "7.0.1",
|
||||
"fs-extra": "11.3.2",
|
||||
"react": "19.2.0",
|
||||
"react-dom": "19.2.0",
|
||||
"typedoc": "0.28.14",
|
||||
"typedoc-plugin-missing-exports": "4.1.2"
|
||||
}
|
||||
}
|
||||
36
apps/build-docs/src/backend_script_entrypoint.ts
Normal file
36
apps/build-docs/src/backend_script_entrypoint.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* The backend script API is accessible to code notes with the "JS (backend)" language.
|
||||
*
|
||||
* The entire API is exposed as a single global: {@link api}
|
||||
*
|
||||
* @module Backend Script API
|
||||
*/
|
||||
|
||||
/**
|
||||
* This file creates the entrypoint for TypeDoc that simulates the context from within a
|
||||
* script note on the server side.
|
||||
*
|
||||
* Make sure to keep in line with backend's `script_context.ts`.
|
||||
*/
|
||||
|
||||
export type { default as AbstractBeccaEntity } from "../../server/src/becca/entities/abstract_becca_entity.js";
|
||||
export type { default as BAttachment } from "../../server/src/becca/entities/battachment.js";
|
||||
export type { default as BAttribute } from "../../server/src/becca/entities/battribute.js";
|
||||
export type { default as BBranch } from "../../server/src/becca/entities/bbranch.js";
|
||||
export type { default as BEtapiToken } from "../../server/src/becca/entities/betapi_token.js";
|
||||
export type { BNote };
|
||||
export type { default as BOption } from "../../server/src/becca/entities/boption.js";
|
||||
export type { default as BRecentNote } from "../../server/src/becca/entities/brecent_note.js";
|
||||
export type { default as BRevision } from "../../server/src/becca/entities/brevision.js";
|
||||
|
||||
import BNote from "../../server/src/becca/entities/bnote.js";
|
||||
import BackendScriptApi, { type Api } from "../../server/src/services/backend_script_api.js";
|
||||
|
||||
export type { Api };
|
||||
|
||||
const fakeNote = new BNote();
|
||||
|
||||
/**
|
||||
* The `api` global variable allows access to the backend script API, which is documented in {@link Api}.
|
||||
*/
|
||||
export const api: Api = new BackendScriptApi(fakeNote, {});
|
||||
@@ -4,14 +4,17 @@ process.env.NODE_ENV = "development";
|
||||
|
||||
import cls from "@triliumnext/server/src/services/cls.js";
|
||||
import { dirname, join, resolve } from "path";
|
||||
import fs, { copyFile } from "fs/promises";
|
||||
import fsExtra, { createWriteStream, type WriteStream } from "fs-extra";
|
||||
import * as fs from "fs/promises";
|
||||
import * as fsExtra from "fs-extra";
|
||||
import archiver from "archiver";
|
||||
import { WriteStream } from "fs";
|
||||
import { execSync } from "child_process";
|
||||
import BuildContext from "./context.js";
|
||||
|
||||
const DOCS_ROOT = "../../../docs";
|
||||
const OUTPUT_DIR = "../../site";
|
||||
|
||||
async function main() {
|
||||
async function buildDocsInner() {
|
||||
const i18n = await import("@triliumnext/server/src/services/i18n.js");
|
||||
await i18n.initializeTranslations();
|
||||
|
||||
@@ -30,7 +33,7 @@ async function main() {
|
||||
"export",
|
||||
null
|
||||
);
|
||||
const fileOutputStream = createWriteStream(zipFilePath);
|
||||
const fileOutputStream = fsExtra.createWriteStream(zipFilePath);
|
||||
await exportToZip(taskContext, branch, "share", fileOutputStream);
|
||||
await waitForStreamToFinish(fileOutputStream);
|
||||
await extractZip(zipFilePath, OUTPUT_DIR);
|
||||
@@ -41,7 +44,7 @@ async function main() {
|
||||
}
|
||||
|
||||
// Copy favicon.
|
||||
await copyFile("../../apps/website/src/assets/favicon.ico", join(OUTPUT_DIR, "favicon.ico"));
|
||||
await fs.copyFile("../../apps/website/src/assets/favicon.ico", join(OUTPUT_DIR, "favicon.ico"));
|
||||
|
||||
console.log("Documentation built successfully!");
|
||||
}
|
||||
@@ -106,4 +109,19 @@ export async function extractZip(zipFilePath: string, outputPath: string, ignore
|
||||
});
|
||||
}
|
||||
|
||||
cls.init(main);
|
||||
export default async function buildDocs({ gitRootDir }: BuildContext) {
|
||||
// Build the share theme.
|
||||
execSync(`pnpm run --filter share-theme build`, {
|
||||
stdio: "inherit",
|
||||
cwd: gitRootDir
|
||||
});
|
||||
|
||||
// Trigger the actual build.
|
||||
await new Promise((res, rej) => {
|
||||
cls.init(() => {
|
||||
buildDocsInner()
|
||||
.catch(rej)
|
||||
.then(res);
|
||||
});
|
||||
});
|
||||
}
|
||||
4
apps/build-docs/src/context.ts
Normal file
4
apps/build-docs/src/context.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export default interface BuildContext {
|
||||
gitRootDir: string;
|
||||
baseDir: string;
|
||||
}
|
||||
28
apps/build-docs/src/frontend_script_entrypoint.ts
Normal file
28
apps/build-docs/src/frontend_script_entrypoint.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* The front script API is accessible to code notes with the "JS (frontend)" language.
|
||||
*
|
||||
* The entire API is exposed as a single global: {@link api}
|
||||
*
|
||||
* @module Frontend Script API
|
||||
*/
|
||||
|
||||
/**
|
||||
* This file creates the entrypoint for TypeDoc that simulates the context from within a
|
||||
* script note.
|
||||
*
|
||||
* Make sure to keep in line with frontend's `script_context.ts`.
|
||||
*/
|
||||
|
||||
export type { default as BasicWidget } from "../../client/src/widgets/basic_widget.js";
|
||||
export type { default as FAttachment } from "../../client/src/entities/fattachment.js";
|
||||
export type { default as FAttribute } from "../../client/src/entities/fattribute.js";
|
||||
export type { default as FBranch } from "../../client/src/entities/fbranch.js";
|
||||
export type { default as FNote } from "../../client/src/entities/fnote.js";
|
||||
export type { Api } from "../../client/src/services/frontend_script_api.js";
|
||||
export type { default as NoteContextAwareWidget } from "../../client/src/widgets/note_context_aware_widget.js";
|
||||
export type { default as RightPanelWidget } from "../../client/src/widgets/right_panel_widget.js";
|
||||
|
||||
import FrontendScriptApi, { type Api } from "../../client/src/services/frontend_script_api.js";
|
||||
|
||||
//@ts-expect-error
|
||||
export const api: Api = new FrontendScriptApi();
|
||||
26
apps/build-docs/src/main.ts
Normal file
26
apps/build-docs/src/main.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { join } from "path";
|
||||
import BuildContext from "./context";
|
||||
import buildSwagger from "./swagger";
|
||||
import { existsSync, mkdirSync, rmSync } from "fs";
|
||||
import buildDocs from "./build-docs";
|
||||
import buildScriptApi from "./script-api";
|
||||
|
||||
const context: BuildContext = {
|
||||
gitRootDir: join(__dirname, "../../../"),
|
||||
baseDir: join(__dirname, "../../../site")
|
||||
};
|
||||
|
||||
async function main() {
|
||||
// Clean input dir.
|
||||
if (existsSync(context.baseDir)) {
|
||||
rmSync(context.baseDir, { recursive: true });
|
||||
}
|
||||
mkdirSync(context.baseDir);
|
||||
|
||||
// Start building.
|
||||
await buildDocs(context);
|
||||
buildSwagger(context);
|
||||
buildScriptApi(context);
|
||||
}
|
||||
|
||||
main();
|
||||
15
apps/build-docs/src/script-api.ts
Normal file
15
apps/build-docs/src/script-api.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { execSync } from "child_process";
|
||||
import BuildContext from "./context";
|
||||
import { join } from "path";
|
||||
|
||||
export default function buildScriptApi({ baseDir, gitRootDir }: BuildContext) {
|
||||
// Generate types
|
||||
execSync(`pnpm typecheck`, { stdio: "inherit", cwd: gitRootDir });
|
||||
|
||||
for (const config of [ "backend", "frontend" ]) {
|
||||
const outDir = join(baseDir, "script-api", config);
|
||||
execSync(`pnpm typedoc --options typedoc.${config}.json --html "${outDir}"`, {
|
||||
stdio: "inherit"
|
||||
});
|
||||
}
|
||||
}
|
||||
32
apps/build-docs/src/swagger.ts
Normal file
32
apps/build-docs/src/swagger.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import BuildContext from "./context";
|
||||
import { join } from "path";
|
||||
import { execSync } from "child_process";
|
||||
import { mkdirSync } from "fs";
|
||||
|
||||
interface BuildInfo {
|
||||
specPath: string;
|
||||
outDir: string;
|
||||
}
|
||||
|
||||
const DIR_PREFIX = "rest-api";
|
||||
|
||||
const buildInfos: BuildInfo[] = [
|
||||
{
|
||||
// Paths are relative to Git root.
|
||||
specPath: "apps/server/internal.openapi.yaml",
|
||||
outDir: `${DIR_PREFIX}/internal`
|
||||
},
|
||||
{
|
||||
specPath: "apps/server/etapi.openapi.yaml",
|
||||
outDir: `${DIR_PREFIX}/etapi`
|
||||
}
|
||||
];
|
||||
|
||||
export default function buildSwagger({ baseDir, gitRootDir }: BuildContext) {
|
||||
for (const { specPath, outDir } of buildInfos) {
|
||||
const absSpecPath = join(gitRootDir, specPath);
|
||||
const targetDir = join(baseDir, outDir);
|
||||
mkdirSync(targetDir, { recursive: true });
|
||||
execSync(`pnpm redocly build-docs ${absSpecPath} -o ${targetDir}/index.html`, { stdio: "inherit" });
|
||||
}
|
||||
}
|
||||
36
apps/build-docs/tsconfig.app.json
Normal file
36
apps/build-docs/tsconfig.app.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"target": "ES2020",
|
||||
"outDir": "dist",
|
||||
"strict": false,
|
||||
"types": [
|
||||
"node",
|
||||
"express"
|
||||
],
|
||||
"rootDir": "src",
|
||||
"tsBuildInfoFile": "dist/tsconfig.app.tsbuildinfo"
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts",
|
||||
"../server/src/*.d.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"eslint.config.js",
|
||||
"eslint.config.cjs",
|
||||
"eslint.config.mjs"
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../server/tsconfig.app.json"
|
||||
},
|
||||
{
|
||||
"path": "../desktop/tsconfig.app.json"
|
||||
},
|
||||
{
|
||||
"path": "../client/tsconfig.app.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
15
apps/build-docs/tsconfig.json
Normal file
15
apps/build-docs/tsconfig.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"include": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "../server"
|
||||
},
|
||||
{
|
||||
"path": "../client"
|
||||
},
|
||||
{
|
||||
"path": "./tsconfig.app.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
10
apps/build-docs/typedoc.backend.json
Normal file
10
apps/build-docs/typedoc.backend.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"$schema": "https://typedoc.org/schema.json",
|
||||
"name": "Trilium Backend API",
|
||||
"entryPoints": [
|
||||
"src/backend_script_entrypoint.ts"
|
||||
],
|
||||
"plugin": [
|
||||
"typedoc-plugin-missing-exports"
|
||||
]
|
||||
}
|
||||
10
apps/build-docs/typedoc.frontend.json
Normal file
10
apps/build-docs/typedoc.frontend.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"$schema": "https://typedoc.org/schema.json",
|
||||
"name": "Trilium Frontend API",
|
||||
"entryPoints": [
|
||||
"src/frontend_script_entrypoint.ts"
|
||||
],
|
||||
"plugin": [
|
||||
"typedoc-plugin-missing-exports"
|
||||
]
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
/**
|
||||
* The front script API is accessible to code notes with the "JS (frontend)" language.
|
||||
*
|
||||
* The entire API is exposed as a single global: {@link api}
|
||||
*
|
||||
* @module Frontend Script API
|
||||
*/
|
||||
|
||||
/**
|
||||
* This file creates the entrypoint for TypeDoc that simulates the context from within a
|
||||
* script note.
|
||||
*
|
||||
* Make sure to keep in line with frontend's `script_context.ts`.
|
||||
*/
|
||||
|
||||
export type { default as BasicWidget } from "../widgets/basic_widget.js";
|
||||
export type { default as FAttachment } from "../entities/fattachment.js";
|
||||
export type { default as FAttribute } from "../entities/fattribute.js";
|
||||
export type { default as FBranch } from "../entities/fbranch.js";
|
||||
export type { default as FNote } from "../entities/fnote.js";
|
||||
export type { Api } from "./frontend_script_api.js";
|
||||
export type { default as NoteContextAwareWidget } from "../widgets/note_context_aware_widget.js";
|
||||
export type { default as RightPanelWidget } from "../widgets/right_panel_widget.js";
|
||||
|
||||
import FrontendScriptApi, { type Api } from "./frontend_script_api.js";
|
||||
|
||||
//@ts-expect-error
|
||||
export const api: Api = new FrontendScriptApi();
|
||||
@@ -23,6 +23,8 @@ if (!DOCS_ROOT || !USER_GUIDE_ROOT) {
|
||||
throw new Error("Missing DOCS_ROOT or USER_GUIDE_ROOT environment variable.");
|
||||
}
|
||||
|
||||
const BASE_URL = "https://docs.triliumnotes.org";
|
||||
|
||||
const NOTE_MAPPINGS: NoteMapping[] = [
|
||||
{
|
||||
rootNoteId: "pOsGYCXsbNQG",
|
||||
@@ -158,6 +160,14 @@ async function cleanUpMeta(outputPath: string, minify: boolean) {
|
||||
}
|
||||
|
||||
el.isExpanded = false;
|
||||
|
||||
// Rewrite web view URLs that point to root.
|
||||
if (el.type === "webView" && minify) {
|
||||
const srcAttr = el.attributes.find(attr => attr.name === "webViewSrc");
|
||||
if (srcAttr.value.startsWith("/")) {
|
||||
srcAttr.value = BASE_URL + srcAttr.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (minify) {
|
||||
|
||||
@@ -4,12 +4,12 @@ info:
|
||||
title: ETAPI
|
||||
description: External Trilium API
|
||||
contact:
|
||||
name: zadam
|
||||
email: zadam.apps@gmail.com
|
||||
url: https://github.com/zadam/trilium
|
||||
name: Trilium Notes Team
|
||||
email: contact@eliandoran.me
|
||||
url: https://triliumnotes.org
|
||||
license:
|
||||
name: Apache 2.0
|
||||
url: https://www.apache.org/licenses/LICENSE-2.0.html
|
||||
name: GNU Affero General Public License v3.0 only
|
||||
url: https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
servers:
|
||||
- url: http://localhost:37740/etapi
|
||||
- url: http://localhost:8080/etapi
|
||||
@@ -1,7 +1,7 @@
|
||||
openapi: 3.1.0
|
||||
info:
|
||||
title: Trilium Notes Internal API
|
||||
version: 0.98.0
|
||||
title: Internal Trilium API
|
||||
version: 0.99.3
|
||||
description: |
|
||||
This is the internal API used by the Trilium Notes client application.
|
||||
|
||||
@@ -24,11 +24,12 @@ info:
|
||||
State-changing operations require CSRF tokens when using session authentication.
|
||||
|
||||
contact:
|
||||
name: TriliumNext Issue Tracker
|
||||
url: https://github.com/TriliumNext/Trilium/issues
|
||||
name: Trilium Notes Team
|
||||
email: contact@eliandoran.me
|
||||
url: https://triliumnotes.org
|
||||
license:
|
||||
name: GNU Affero General Public License v3.0
|
||||
url: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
name: GNU Affero General Public License v3.0 only
|
||||
url: https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
|
||||
servers:
|
||||
- url: http://localhost:8080
|
||||
@@ -61,7 +61,6 @@
|
||||
"@types/serve-static": "2.2.0",
|
||||
"@types/stream-throttle": "0.1.4",
|
||||
"@types/supertest": "6.0.3",
|
||||
"@types/swagger-ui-express": "4.1.8",
|
||||
"@types/tmp": "0.2.6",
|
||||
"@types/turndown": "5.0.6",
|
||||
"@types/ws": "8.18.1",
|
||||
@@ -123,7 +122,6 @@
|
||||
"striptags": "3.2.0",
|
||||
"supertest": "7.1.4",
|
||||
"swagger-jsdoc": "6.2.8",
|
||||
"swagger-ui-express": "5.0.1",
|
||||
"time2fa": "1.4.2",
|
||||
"tmp": "0.2.5",
|
||||
"turndown": "7.2.2",
|
||||
|
||||
2
apps/server/src/assets/doc_notes/en/User Guide/!!!meta.json
generated
vendored
2
apps/server/src/assets/doc_notes/en/User Guide/!!!meta.json
generated
vendored
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
|
||||
import { BNote } from "../../services/backend_script_entrypoint";
|
||||
import BNote from '../../becca/entities/bnote.js';
|
||||
import cls from "../../services/cls";
|
||||
import { buildNote } from "../../test/becca_easy_mocking";
|
||||
import { processContent } from "./clipper";
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
import type { Application } from "express";
|
||||
import swaggerUi from "swagger-ui-express";
|
||||
import { join } from "path";
|
||||
import yaml from "js-yaml";
|
||||
import type { JsonObject } from "swagger-ui-express";
|
||||
import { readFileSync } from "fs";
|
||||
import { RESOURCE_DIR } from "../services/resource_dir";
|
||||
|
||||
export default function register(app: Application) {
|
||||
const etapiDocument = yaml.load(readFileSync(join(RESOURCE_DIR, "etapi.openapi.yaml"), "utf8")) as JsonObject;
|
||||
|
||||
// Load the comprehensive API documentation from YAML
|
||||
const apiDocument = yaml.load(readFileSync(join(RESOURCE_DIR, "api-openapi.yaml"), "utf8")) as JsonObject;
|
||||
|
||||
app.use(
|
||||
"/etapi/docs/",
|
||||
swaggerUi.serveFiles(etapiDocument),
|
||||
swaggerUi.setup(etapiDocument, {
|
||||
explorer: true,
|
||||
customSiteTitle: "TriliumNext ETAPI Documentation"
|
||||
})
|
||||
);
|
||||
|
||||
app.use(
|
||||
"/api/docs/",
|
||||
swaggerUi.serveFiles(apiDocument),
|
||||
swaggerUi.setup(apiDocument, {
|
||||
explorer: true,
|
||||
customSiteTitle: "TriliumNext Internal API Documentation",
|
||||
customCss: '.swagger-ui .topbar { display: none }'
|
||||
})
|
||||
);
|
||||
}
|
||||
@@ -70,7 +70,6 @@ import etapiSpecialNoteRoutes from "../etapi/special_notes.js";
|
||||
import etapiSpecRoute from "../etapi/spec.js";
|
||||
import etapiBackupRoute from "../etapi/backup.js";
|
||||
import etapiMetricsRoute from "../etapi/metrics.js";
|
||||
import apiDocsRoute from "./api_docs.js";
|
||||
import { apiResultHandler, apiRoute, asyncApiRoute, asyncRoute, route, router, uploadMiddlewareWithErrorHandling } from "./route_api.js";
|
||||
|
||||
const GET = "get",
|
||||
@@ -383,9 +382,6 @@ function register(app: express.Application) {
|
||||
asyncApiRoute(GET, "/api/llm/providers/openai/models", openaiRoute.listModels);
|
||||
asyncApiRoute(GET, "/api/llm/providers/anthropic/models", anthropicRoute.listModels);
|
||||
|
||||
// API Documentation
|
||||
apiDocsRoute(app);
|
||||
|
||||
app.use("", router);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
/**
|
||||
* The backend script API is accessible to code notes with the "JS (backend)" language.
|
||||
*
|
||||
* The entire API is exposed as a single global: {@link api}
|
||||
*
|
||||
* @module Backend Script API
|
||||
*/
|
||||
|
||||
/**
|
||||
* This file creates the entrypoint for TypeDoc that simulates the context from within a
|
||||
* script note on the server side.
|
||||
*
|
||||
* Make sure to keep in line with backend's `script_context.ts`.
|
||||
*/
|
||||
|
||||
export type { default as AbstractBeccaEntity } from "../becca/entities/abstract_becca_entity.js";
|
||||
export type { default as BAttachment } from "../becca/entities/battachment.js";
|
||||
export type { default as BAttribute } from "../becca/entities/battribute.js";
|
||||
export type { default as BBranch } from "../becca/entities/bbranch.js";
|
||||
export type { default as BEtapiToken } from "../becca/entities/betapi_token.js";
|
||||
export type { BNote };
|
||||
export type { default as BOption } from "../becca/entities/boption.js";
|
||||
export type { default as BRecentNote } from "../becca/entities/brecent_note.js";
|
||||
export type { default as BRevision } from "../becca/entities/brevision.js";
|
||||
|
||||
import BNote from "../becca/entities/bnote.js";
|
||||
import type { Api } from "./backend_script_api.js";
|
||||
import BackendScriptApi from "./backend_script_api.js";
|
||||
|
||||
export type { Api };
|
||||
|
||||
const fakeNote = new BNote();
|
||||
|
||||
/**
|
||||
* The `code` api global variable allows access to the backend script API, which is documented in {@link Api}.
|
||||
*/
|
||||
export const api: Api = new BackendScriptApi(fakeNote, {});
|
||||
@@ -9,7 +9,7 @@ import log from '../../log.js';
|
||||
import becca from '../../../becca/becca.js';
|
||||
import notes from '../../notes.js';
|
||||
import attributes from '../../attributes.js';
|
||||
import type { BNote } from '../../backend_script_entrypoint.js';
|
||||
import BNote from '../../../becca/entities/bnote.js';
|
||||
|
||||
/**
|
||||
* Definition of the note creation tool
|
||||
|
||||
@@ -9,7 +9,7 @@ import searchService from "./search/services/search.js";
|
||||
import SearchContext from "./search/search_context.js";
|
||||
import { LBTPL_NOTE_LAUNCHER, LBTPL_CUSTOM_WIDGET, LBTPL_SPACER, LBTPL_SCRIPT } from "./hidden_subtree.js";
|
||||
import { t } from "i18next";
|
||||
import { BNote } from "./backend_script_entrypoint.js";
|
||||
import BNote from '../becca/entities/bnote.js';
|
||||
import { SaveSearchNoteResponse, SaveSqlConsoleResponse } from "@triliumnext/commons";
|
||||
|
||||
function getInboxNote(date: string) {
|
||||
|
||||
@@ -16,7 +16,7 @@ import { join } from "path";
|
||||
import { readFileSync } from "fs";
|
||||
import { highlightAuto } from "@triliumnext/highlightjs";
|
||||
import becca from "../becca/becca.js";
|
||||
import { BAttachment } from "../services/backend_script_entrypoint.js";
|
||||
import BAttachment from '../becca/entities/battachment.js';
|
||||
import SAttachment from "./shaca/entities/sattachment.js";
|
||||
import { sanitizeUrl } from "@braintree/sanitize-url";
|
||||
|
||||
|
||||
10
docs/User Guide/!!!meta.json
vendored
10
docs/User Guide/!!!meta.json
vendored
@@ -12594,7 +12594,7 @@
|
||||
{
|
||||
"type": "label",
|
||||
"name": "webViewSrc",
|
||||
"value": "/etapi/docs",
|
||||
"value": "/rest-api/etapi/",
|
||||
"isInheritable": false,
|
||||
"position": 10
|
||||
},
|
||||
@@ -13612,7 +13612,7 @@
|
||||
{
|
||||
"type": "label",
|
||||
"name": "webViewSrc",
|
||||
"value": "/api/docs",
|
||||
"value": "/rest-api/internal/",
|
||||
"isInheritable": false,
|
||||
"position": 10
|
||||
},
|
||||
@@ -14968,7 +14968,7 @@
|
||||
{
|
||||
"type": "label",
|
||||
"name": "webViewSrc",
|
||||
"value": "https://triliumnext.github.io/Notes/Script%20API/interfaces/Frontend_Script_API.Api.html",
|
||||
"value": "/script-api/frontend",
|
||||
"isInheritable": false,
|
||||
"position": 10
|
||||
},
|
||||
@@ -15003,7 +15003,7 @@
|
||||
{
|
||||
"type": "label",
|
||||
"name": "webViewSrc",
|
||||
"value": "https://triliumnext.github.io/Notes/Script%20API/classes/Frontend_Script_API.FNote.html",
|
||||
"value": "/script-api/frontend/interfaces/FNote.html",
|
||||
"isInheritable": false,
|
||||
"position": 10
|
||||
},
|
||||
@@ -15039,7 +15039,7 @@
|
||||
{
|
||||
"type": "label",
|
||||
"name": "webViewSrc",
|
||||
"value": "https://triliumnext.github.io/Notes/Script%20API/interfaces/Backend_Script_API.Api.html",
|
||||
"value": "/script-api/backend",
|
||||
"isInheritable": false,
|
||||
"position": 10
|
||||
},
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
"chore:generate-openapi": "tsx ./scripts/generate-openapi.ts",
|
||||
"chore:update-build-info": "tsx ./scripts/update-build-info.ts",
|
||||
"chore:update-version": "tsx ./scripts/update-version.ts",
|
||||
"docs:build": "pnpm run --filter share-theme build && cd ./apps/edit-docs && tsx ./src/build-docs.ts",
|
||||
"docs:build": "pnpm run --filter build-docs start",
|
||||
"edit-docs:edit-docs": "pnpm run --filter edit-docs edit-docs",
|
||||
"edit-docs:edit-demo": "pnpm run --filter edit-docs edit-demo",
|
||||
"test:all": "pnpm test:parallel && pnpm test:sequential",
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
"devDependencies": {
|
||||
"@digitak/esrun": "3.2.26",
|
||||
"@triliumnext/ckeditor5": "workspace:*",
|
||||
"@types/swagger-ui": "5.21.1",
|
||||
"@typescript-eslint/eslint-plugin": "8.46.2",
|
||||
"@typescript-eslint/parser": "8.46.2",
|
||||
"dotenv": "17.2.3",
|
||||
|
||||
@@ -54,17 +54,25 @@ body:not(.math-loaded) .math-tex {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
body.type-webView #main {
|
||||
max-width: unset;
|
||||
}
|
||||
body.type-webView {
|
||||
#main {
|
||||
max-width: unset;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body.type-webView #content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
#content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
|
||||
iframe.webview {
|
||||
width: 100%;
|
||||
flex-grow: 1;
|
||||
h1 {
|
||||
display: none;
|
||||
}
|
||||
|
||||
iframe.webview {
|
||||
width: 100%;
|
||||
flex-grow: 1;
|
||||
border: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
1478
pnpm-lock.yaml
generated
1478
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user