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
|
|
|
|
2024-02-17 00:44:44 +02:00
|
|
|
export interface AttachmentRow {
|
|
|
|
attachmentId?: string;
|
2024-02-17 10:56:27 +02:00
|
|
|
ownerId?: string;
|
2024-02-17 00:44:44 +02:00
|
|
|
role: string;
|
|
|
|
mime: string;
|
2024-04-03 18:53:56 +03:00
|
|
|
title: string;
|
2024-02-17 00:44:44 +02:00
|
|
|
position?: number;
|
2024-02-17 10:56:27 +02:00
|
|
|
blobId?: string;
|
2024-02-17 00:44:44 +02:00
|
|
|
isProtected?: boolean;
|
|
|
|
dateModified?: string;
|
|
|
|
utcDateModified?: string;
|
|
|
|
utcDateScheduledForErasureSince?: string;
|
|
|
|
contentLength?: number;
|
2024-02-17 22:58:54 +02:00
|
|
|
content?: Buffer | string;
|
2024-02-17 00:44:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface RevisionRow {
|
2024-02-17 10:56:27 +02:00
|
|
|
revisionId?: string;
|
2024-02-17 00:44:44 +02:00
|
|
|
noteId: string;
|
|
|
|
type: string;
|
|
|
|
mime: string;
|
2024-02-17 10:56:27 +02:00
|
|
|
isProtected?: boolean;
|
2024-02-17 00:44:44 +02:00
|
|
|
title: string;
|
2024-02-17 10:56:27 +02:00
|
|
|
blobId?: string;
|
|
|
|
dateLastEdited?: string;
|
2024-02-17 00:44:44 +02:00
|
|
|
dateCreated: string;
|
2024-02-17 10:56:27 +02:00
|
|
|
utcDateLastEdited?: string;
|
2024-02-17 00:44:44 +02:00
|
|
|
utcDateCreated: string;
|
|
|
|
utcDateModified: string;
|
|
|
|
contentLength?: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface RecentNoteRow {
|
|
|
|
noteId: string;
|
|
|
|
notePath: string;
|
|
|
|
utcDateCreated?: string;
|
|
|
|
}
|
2024-02-17 01:00:38 +02:00
|
|
|
|
2024-11-02 00:55:45 +02:00
|
|
|
/**
|
|
|
|
* Database representation of an option.
|
2024-12-22 15:45:54 +02:00
|
|
|
*
|
2024-11-02 00:55:45 +02:00
|
|
|
* Options are key-value pairs that are used to store information such as user preferences (for example
|
|
|
|
* the current theme, sync server information), but also information about the state of the application).
|
|
|
|
*/
|
2024-02-17 01:00:38 +02:00
|
|
|
export interface OptionRow {
|
2024-11-02 00:55:45 +02:00
|
|
|
/** The name of the option. */
|
2024-02-17 01:00:38 +02:00
|
|
|
name: string;
|
2024-11-02 00:55:45 +02:00
|
|
|
/** The value of the option. */
|
2024-02-17 01:00:38 +02:00
|
|
|
value: string;
|
2024-11-02 00:55:45 +02:00
|
|
|
/** `true` if the value should be synced across multiple instances (e.g. locale) or `false` if it should be local-only (e.g. theme). */
|
2024-02-17 01:00:38 +02:00
|
|
|
isSynced: boolean;
|
2024-07-18 22:30:16 +03:00
|
|
|
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;
|
2024-07-18 22:58:12 +03:00
|
|
|
position?: number | null;
|
2024-02-17 22:58:54 +02:00
|
|
|
value?: string;
|
|
|
|
isInheritable?: boolean;
|
2024-02-17 10:56:27 +02:00
|
|
|
utcDateModified?: string;
|
2024-02-17 02:02:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface BranchRow {
|
|
|
|
branchId?: string;
|
|
|
|
noteId: string;
|
|
|
|
parentNoteId: string;
|
2024-02-17 22:58:54 +02:00
|
|
|
prefix?: string | null;
|
2024-02-18 11:47:32 +02:00
|
|
|
notePosition?: number | null;
|
2024-02-17 22:58:54 +02:00
|
|
|
isExpanded?: boolean;
|
|
|
|
isDeleted?: boolean;
|
2024-02-17 02:02:08 +02:00
|
|
|
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.
|
|
|
|
*/
|
2024-09-02 23:31:49 +03:00
|
|
|
export const ALLOWED_NOTE_TYPES = [ "file", "image", "search", "noteMap", "launcher", "doc", "contentWidget", "text", "relationMap", "render", "canvas", "mermaid", "book", "webView", "code", "mindMap" ] as const;
|
2024-07-13 16:43:33 +03:00
|
|
|
export type NoteType = typeof ALLOWED_NOTE_TYPES[number];
|
2024-02-17 10:56:27 +02:00
|
|
|
|
|
|
|
export interface NoteRow {
|
|
|
|
noteId: string;
|
2024-02-17 22:58:54 +02:00
|
|
|
deleteId: string;
|
2024-02-17 10:56:27 +02:00
|
|
|
title: string;
|
|
|
|
type: NoteType;
|
|
|
|
mime: string;
|
|
|
|
isProtected: boolean;
|
2024-02-17 22:58:54 +02:00
|
|
|
isDeleted: boolean;
|
2024-02-17 10:56:27 +02:00
|
|
|
blobId: string;
|
|
|
|
dateCreated: string;
|
|
|
|
dateModified: string;
|
|
|
|
utcDateCreated: string;
|
|
|
|
utcDateModified: string;
|
2024-07-13 16:52:31 +03:00
|
|
|
content?: string | Buffer;
|
2024-02-17 22:58:54 +02:00
|
|
|
}
|