server-ts: Port services/meta/*

This commit is contained in:
Elian Doran 2024-02-17 21:01:31 +02:00
parent 748a551def
commit 45582ebaac
No known key found for this signature in database
7 changed files with 46 additions and 69 deletions

View File

@ -16,9 +16,9 @@ const archiver = require('archiver');
const log = require('../log');
const TaskContext = require('../task_context');
const ValidationError = require('../../errors/validation_error');
const NoteMeta = require('../meta/note_meta.js');
const AttachmentMeta = require('../meta/attachment_meta.js');
const AttributeMeta = require('../meta/attribute_meta.js');
const NoteMeta = require('../meta/note_meta');
const AttachmentMeta = require('../meta/attachment_meta');
const AttributeMeta = require('../meta/attribute_meta');
/**
* @param {TaskContext} taskContext

View File

@ -1,16 +0,0 @@
class AttachmentMeta {
/** @type {string} */
attachmentId;
/** @type {string} */
title;
/** @type {string} */
role;
/** @type {string} */
mime;
/** @type {int} */
position;
/** @type {string} */
dataFileName;
}
module.exports = AttachmentMeta;

View File

@ -0,0 +1,10 @@
interface AttachmentMeta {
attachmentId: string;
title: string;
role: string;
mime: string;
position: number;
dataFileName: string;
}
export = AttachmentMeta;

View File

@ -1,14 +0,0 @@
class AttributeMeta {
/** @type {string} */
type;
/** @type {string} */
name;
/** @type {string} */
value;
/** @type {boolean} */
isInheritable;
/** @type {int} */
position;
}
module.exports = AttributeMeta;

View File

@ -0,0 +1,9 @@
interface AttributeMeta {
type: string;
name: string;
value: string;
isInheritable: boolean;
position: number;
}
export = AttributeMeta;

View File

@ -1,36 +0,0 @@
class NoteMeta {
/** @type {string} */
noteId;
/** @type {string} */
notePath;
/** @type {boolean} */
isClone;
/** @type {string} */
title;
/** @type {int} */
notePosition;
/** @type {string} */
prefix;
/** @type {boolean} */
isExpanded;
/** @type {string} */
type;
/** @type {string} */
mime;
/** @type {string} - 'html' or 'markdown', applicable to text notes only */
format;
/** @type {string} */
dataFileName;
/** @type {string} */
dirFileName;
/** @type {boolean} - this file should not be imported (e.g., HTML navigation) */
noImport = false;
/** @type {AttributeMeta[]} */
attributes;
/** @type {AttachmentMeta[]} */
attachments;
/** @type {NoteMeta[]|undefined} */
children;
}
module.exports = NoteMeta;

View File

@ -0,0 +1,24 @@
import AttributeMeta = require("./attribute_meta");
interface NoteMeta {
noteId: string;
notePath: string;
isClone: boolean;
title: string;
notePosition: number;
prefix: string;
isExpanded: boolean;
type: string;
mime: string;
/** 'html' or 'markdown', applicable to text notes only */
format: "html" | "markdown";
dataFileName: string;
dirFileName: string;
/** this file should not be imported (e.g., HTML navigation) */
noImport: boolean;
attributes: AttributeMeta[];
attachments: AttributeMeta[];
children?: NoteMeta[];
}
export = NoteMeta;