server-ts: Convert services/backend_script_api

This commit is contained in:
Elian Doran
2024-04-04 22:00:20 +03:00
parent a154dc76ce
commit 15dee4b952
8 changed files with 427 additions and 471 deletions

View File

@@ -25,6 +25,7 @@ import ws = require('./ws');
import html2plaintext = require('html2plaintext');
import { AttachmentRow, AttributeRow, BranchRow, NoteRow, NoteType } from '../becca/entities/rows';
import TaskContext = require('./task_context');
import { NoteParams } from './note-interface';
interface FoundLink {
name: "imageLink" | "internalLink" | "includeNoteLink" | "relationMapLink",
@@ -152,31 +153,6 @@ function getAndValidateParent(params: GetValidateParams) {
return parentNote;
}
interface NoteParams {
/** optionally can force specific noteId */
noteId?: string;
branchId?: string;
parentNoteId: string;
templateNoteId?: string;
title: string;
content: string;
type: NoteType;
/** default value is derived from default mimes for type */
mime?: string;
/** default is false */
isProtected?: boolean;
/** default is false */
isExpanded?: boolean;
/** default is empty string */
prefix?: string | null;
/** default is the last existing notePosition in a parent + 10 */
notePosition?: number;
dateCreated?: string;
utcDateCreated?: string;
ignoreForbiddenParents?: boolean;
target?: "into";
}
function createNewNote(params: NoteParams): {
note: BNote;
branch: BBranch;