112 lines
2.7 KiB
TypeScript
Raw Normal View History

2024-02-18 20:29:23 +02:00
// TODO: Booleans should probably be numbers instead (as SQLite does not have booleans.);
2024-02-17 01:00:38 +02:00
export interface AttachmentRow {
attachmentId?: string;
2024-02-17 10:56:27 +02:00
ownerId?: string;
role: string;
mime: string;
title: string;
position?: number;
2024-02-17 10:56:27 +02:00
blobId?: string;
isProtected?: boolean;
dateModified?: string;
utcDateModified?: string;
utcDateScheduledForErasureSince?: string;
contentLength?: number;
content?: Buffer | string;
}
export interface RevisionRow {
2024-02-17 10:56:27 +02:00
revisionId?: string;
noteId: string;
type: string;
mime: string;
2024-02-17 10:56:27 +02:00
isProtected?: boolean;
title: string;
2024-02-17 10:56:27 +02:00
blobId?: string;
dateLastEdited?: string;
dateCreated: string;
2024-02-17 10:56:27 +02:00
utcDateLastEdited?: string;
utcDateCreated: string;
utcDateModified: string;
contentLength?: number;
}
export interface RecentNoteRow {
noteId: string;
notePath: string;
utcDateCreated?: string;
}
2024-02-17 01:00:38 +02:00
export interface OptionRow {
name: string;
value: string;
isSynced: boolean;
utcDateModified: string;
2024-02-17 01:03:38 +02:00
}
export interface EtapiTokenRow {
2024-02-17 19:55:40 +02:00
etapiTokenId?: string;
2024-02-17 01:03:38 +02:00
name: string;
tokenHash: string;
utcDateCreated?: string;
utcDateModified?: string;
2024-02-17 19:55:40 +02:00
isDeleted?: boolean;
2024-02-17 01:06:07 +02:00
}
export interface BlobRow {
blobId: string;
content: string | Buffer;
contentLength: number;
dateModified: string;
utcDateModified: string;
2024-02-17 01:19:49 +02:00
}
2024-04-03 22:46:14 +03:00
export type AttributeType = "label" | "relation" | "label-definition" | "relation-definition";
2024-02-17 01:19:49 +02:00
export interface AttributeRow {
attributeId?: string;
2024-02-18 11:26:05 +02:00
noteId?: string;
2024-02-17 01:19:49 +02:00
type: AttributeType;
name: string;
position?: number;
value?: string;
isInheritable?: boolean;
2024-02-17 10:56:27 +02:00
utcDateModified?: string;
}
export interface BranchRow {
branchId?: string;
noteId: string;
parentNoteId: string;
prefix?: string | null;
2024-02-18 11:47:32 +02:00
notePosition?: number | null;
isExpanded?: boolean;
isDeleted?: boolean;
utcDateModified?: string;
2024-02-17 10:56:27 +02:00
}
/**
* There are many different Note types, some of which are entirely opaque to the
* end user. Those types should be used only for checking against, they are
* not for direct use.
*/
export const ALLOWED_NOTE_TYPES = [ "file", "image", "search", "noteMap", "launcher", "doc", "contentWidget", "text", "relationMap", "render", "canvas", "mermaid", "book", "webView", "code" ] as const;
export type NoteType = typeof ALLOWED_NOTE_TYPES[number];
2024-02-17 10:56:27 +02:00
export interface NoteRow {
noteId: string;
deleteId: string;
2024-02-17 10:56:27 +02:00
title: string;
type: NoteType;
mime: string;
isProtected: boolean;
isDeleted: boolean;
2024-02-17 10:56:27 +02:00
blobId: string;
dateCreated: string;
dateModified: string;
utcDateCreated: string;
utcDateModified: string;
content?: string | Buffer;
}