feat: Initial clean release of CHM
一些检查失败了
automerge / automerge (push) Has been cancelled
react-native-android-build-apk / AssembleRelease (push) Has been cancelled
Build macOS M1 / Main (push) Has been cancelled
Joplin Continuous Integration / Main (macos-15-intel) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-11-vs2026-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-2025) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04-arm) (push) Has been cancelled
Joplin UI tests / Main (ubuntu-22.04) (push) Has been cancelled
Joplin UI tests / Main (windows-2025) (push) Has been cancelled
Joplin UI tests / Mobile (push) Has been cancelled
Close stale issues / ProcessStaleIssues (push) Has been cancelled
一些检查失败了
automerge / automerge (push) Has been cancelled
react-native-android-build-apk / AssembleRelease (push) Has been cancelled
Build macOS M1 / Main (push) Has been cancelled
Joplin Continuous Integration / Main (macos-15-intel) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-11-vs2026-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-2025) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04-arm) (push) Has been cancelled
Joplin UI tests / Main (ubuntu-22.04) (push) Has been cancelled
Joplin UI tests / Main (windows-2025) (push) Has been cancelled
Joplin UI tests / Mobile (push) Has been cancelled
Close stale issues / ProcessStaleIssues (push) Has been cancelled
这个提交包含在:
@@ -0,0 +1,4 @@
|
||||
export default (num: number) => {
|
||||
const timestamp = Date.now();
|
||||
return { sql: 'INSERT INTO migrations (number, created_time, updated_time) VALUES (?, ?, ?)', params: [num, timestamp, timestamp] };
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
// Syntax errors have a code 0 (no error) so we need to check the message.
|
||||
export default (sqliteError: { message?: string }) => {
|
||||
return sqliteError.message && sqliteError.message.includes('syntax error');
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
import addMigrationFile from '../addMigrationFile';
|
||||
import { SqlQuery } from '../types';
|
||||
|
||||
export default (): (SqlQuery|string)[] => {
|
||||
return [
|
||||
addMigrationFile(42),
|
||||
];
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
import { SqlQuery } from '../types';
|
||||
|
||||
export default (): (SqlQuery|string)[] => {
|
||||
return [
|
||||
'ALTER TABLE `notes` ADD COLUMN `user_data` TEXT NOT NULL DEFAULT ""',
|
||||
'ALTER TABLE `tags` ADD COLUMN `user_data` TEXT NOT NULL DEFAULT ""',
|
||||
'ALTER TABLE `folders` ADD COLUMN `user_data` TEXT NOT NULL DEFAULT ""',
|
||||
'ALTER TABLE `resources` ADD COLUMN `user_data` TEXT NOT NULL DEFAULT ""',
|
||||
];
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
import { SqlQuery } from '../types';
|
||||
|
||||
export default (): (SqlQuery|string)[] => {
|
||||
return [
|
||||
'ALTER TABLE `resources` ADD COLUMN blob_updated_time INT NOT NULL DEFAULT 0',
|
||||
'UPDATE `resources` SET blob_updated_time = updated_time',
|
||||
];
|
||||
};
|
||||
@@ -0,0 +1,74 @@
|
||||
import sqlStringToLines from '../sqlStringToLines';
|
||||
import { SqlQuery } from '../types';
|
||||
|
||||
export default (): (SqlQuery|string)[] => {
|
||||
const queries: (SqlQuery|string)[] = [];
|
||||
|
||||
queries.push('ALTER TABLE `resources` ADD COLUMN `ocr_text` TEXT NOT NULL DEFAULT ""');
|
||||
queries.push('ALTER TABLE `resources` ADD COLUMN `ocr_details` TEXT NOT NULL DEFAULT ""');
|
||||
queries.push('ALTER TABLE `resources` ADD COLUMN `ocr_status` INT NOT NULL DEFAULT 0');
|
||||
queries.push('ALTER TABLE `resources` ADD COLUMN `ocr_error` TEXT NOT NULL DEFAULT ""');
|
||||
|
||||
const itemsNormalized = `
|
||||
CREATE TABLE items_normalized (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
title TEXT NOT NULL DEFAULT "",
|
||||
body TEXT NOT NULL DEFAULT "",
|
||||
item_id TEXT NOT NULL,
|
||||
item_type INT NOT NULL,
|
||||
user_updated_time INT NOT NULL DEFAULT 0,
|
||||
reserved1 INT NULL,
|
||||
reserved2 INT NULL,
|
||||
reserved3 INT NULL,
|
||||
reserved4 INT NULL,
|
||||
reserved5 INT NULL,
|
||||
reserved6 INT NULL
|
||||
);
|
||||
`;
|
||||
|
||||
queries.push(sqlStringToLines(itemsNormalized)[0]);
|
||||
|
||||
queries.push('CREATE INDEX items_normalized_id ON items_normalized (id)');
|
||||
queries.push('CREATE INDEX items_normalized_item_id ON items_normalized (item_id)');
|
||||
queries.push('CREATE INDEX items_normalized_item_type ON items_normalized (item_type)');
|
||||
|
||||
const tableFields = 'id, title, body, item_id, item_type, user_updated_time, reserved1, reserved2, reserved3, reserved4, reserved5, reserved6';
|
||||
|
||||
const newVirtualTableSql = `
|
||||
CREATE VIRTUAL TABLE items_fts USING fts4(
|
||||
content="items_normalized",
|
||||
notindexed="id",
|
||||
notindexed="item_id",
|
||||
notindexed="item_type",
|
||||
notindexed="user_updated_time",
|
||||
notindexed="reserved1",
|
||||
notindexed="reserved2",
|
||||
notindexed="reserved3",
|
||||
notindexed="reserved4",
|
||||
notindexed="reserved5",
|
||||
notindexed="reserved6",
|
||||
${tableFields}
|
||||
);`
|
||||
;
|
||||
|
||||
queries.push(sqlStringToLines(newVirtualTableSql)[0]);
|
||||
|
||||
queries.push(`
|
||||
CREATE TRIGGER items_fts_before_update BEFORE UPDATE ON items_normalized BEGIN
|
||||
DELETE FROM items_fts WHERE docid=old.rowid;
|
||||
END;`);
|
||||
queries.push(`
|
||||
CREATE TRIGGER items_fts_before_delete BEFORE DELETE ON items_normalized BEGIN
|
||||
DELETE FROM items_fts WHERE docid=old.rowid;
|
||||
END;`);
|
||||
queries.push(`
|
||||
CREATE TRIGGER items_after_update AFTER UPDATE ON items_normalized BEGIN
|
||||
INSERT INTO items_fts(docid, ${tableFields}) SELECT rowid, ${tableFields} FROM items_normalized WHERE new.rowid = items_normalized.rowid;
|
||||
END;`);
|
||||
queries.push(`
|
||||
CREATE TRIGGER items_after_insert AFTER INSERT ON items_normalized BEGIN
|
||||
INSERT INTO items_fts(docid, ${tableFields}) SELECT rowid, ${tableFields} FROM items_normalized WHERE new.rowid = items_normalized.rowid;
|
||||
END;`);
|
||||
|
||||
return queries;
|
||||
};
|
||||
@@ -0,0 +1,26 @@
|
||||
import { SqlQuery } from '../types';
|
||||
|
||||
export default (): (SqlQuery|string)[] => {
|
||||
return [
|
||||
'ALTER TABLE `notes` ADD COLUMN `deleted_time` INT NOT NULL DEFAULT 0',
|
||||
'ALTER TABLE `folders` ADD COLUMN `deleted_time` INT NOT NULL DEFAULT 0',
|
||||
'DROP VIEW tags_with_note_count',
|
||||
`
|
||||
CREATE VIEW tags_with_note_count AS
|
||||
SELECT
|
||||
tags.id as id,
|
||||
tags.title as title,
|
||||
tags.created_time as created_time,
|
||||
tags.updated_time as updated_time,
|
||||
COUNT(notes.id) as note_count,
|
||||
SUM(CASE WHEN notes.todo_completed > 0 THEN 1 ELSE 0 END) AS todo_completed_count
|
||||
FROM tags
|
||||
LEFT JOIN note_tags nt on nt.tag_id = tags.id
|
||||
LEFT JOIN notes on notes.id = nt.note_id
|
||||
WHERE
|
||||
notes.id IS NOT NULL
|
||||
AND notes.deleted_time = 0
|
||||
GROUP BY tags.id
|
||||
`,
|
||||
];
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
import { SqlQuery } from '../types';
|
||||
|
||||
export default (): (SqlQuery|string)[] => {
|
||||
return [
|
||||
'ALTER TABLE sync_items ADD COLUMN sync_warning_ignored INT NOT NULL DEFAULT "0"',
|
||||
];
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
import { SqlQuery } from '../types';
|
||||
|
||||
export default (): (SqlQuery|string)[] => {
|
||||
return [
|
||||
'ALTER TABLE `resources` ADD COLUMN `ocr_driver_id` INT NOT NULL DEFAULT "1"',
|
||||
];
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
import { SqlQuery } from '../types';
|
||||
|
||||
export default (): (SqlQuery|string)[] => {
|
||||
return [
|
||||
'ALTER TABLE sync_items ADD COLUMN remote_item_updated_time INT NOT NULL DEFAULT 0',
|
||||
];
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
import { SqlQuery } from '../types';
|
||||
|
||||
export default (): (SqlQuery|string)[] => {
|
||||
return [
|
||||
'ALTER TABLE notes ADD COLUMN is_locked INT NOT NULL DEFAULT 0',
|
||||
'ALTER TABLE notes ADD COLUMN extracted_resource_ids TEXT NOT NULL DEFAULT ""',
|
||||
'ALTER TABLE revisions ADD COLUMN is_locked INT NOT NULL DEFAULT 0',
|
||||
'ALTER TABLE resources ADD COLUMN is_locked INT NOT NULL DEFAULT 0',
|
||||
];
|
||||
};
|
||||
@@ -0,0 +1,17 @@
|
||||
import { SqlQuery } from '../types';
|
||||
|
||||
export default (): (SqlQuery|string)[] => {
|
||||
return [
|
||||
'ALTER TABLE sync_items ADD COLUMN base_body TEXT NOT NULL DEFAULT ""',
|
||||
'ALTER TABLE sync_items ADD COLUMN base_title TEXT NOT NULL DEFAULT ""',
|
||||
'ALTER TABLE sync_items ADD COLUMN base_conflict_note_id TEXT NOT NULL DEFAULT ""',
|
||||
`CREATE TABLE IF NOT EXISTS conflict_note_states (
|
||||
note_id TEXT PRIMARY KEY,
|
||||
base_body TEXT NOT NULL DEFAULT "",
|
||||
base_title TEXT NOT NULL DEFAULT "",
|
||||
remote_body TEXT NOT NULL DEFAULT "",
|
||||
remote_title TEXT NOT NULL DEFAULT "",
|
||||
remote_updated_time INT NOT NULL DEFAULT 0
|
||||
)`,
|
||||
];
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
import { SqlQuery } from '../types';
|
||||
|
||||
// Storage for the AI embeddings index. Two tables:
|
||||
//
|
||||
// - `note_embeddings_meta` holds the per-chunk metadata. It is a regular table
|
||||
// so the metadata (chunk text, source note ID, model identifier) can be
|
||||
// inspected and managed even on platforms where the sqlite-vec extension
|
||||
// isn't available.
|
||||
//
|
||||
// - `note_embeddings_vec` is the sqlite-vec virtual table holding the actual
|
||||
// vectors. It is created lazily by the embeddings code when sqlite-vec is
|
||||
// available, because virtual-table syntax differs by extension version and
|
||||
// trying to create it unconditionally would break startup on platforms
|
||||
// without the prebuilt.
|
||||
//
|
||||
// Neither table is synced — embeddings are large, model-specific, and easily
|
||||
// re-derivable on demand.
|
||||
|
||||
export default (): (SqlQuery|string)[] => {
|
||||
return [
|
||||
`CREATE TABLE IF NOT EXISTS note_embeddings_meta (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
note_id TEXT NOT NULL,
|
||||
chunk_index INTEGER NOT NULL,
|
||||
model_id TEXT NOT NULL,
|
||||
chunk_text TEXT NOT NULL,
|
||||
created_time INT NOT NULL DEFAULT 0
|
||||
)`,
|
||||
'CREATE INDEX IF NOT EXISTS note_embeddings_meta_note_id ON note_embeddings_meta(note_id)',
|
||||
'CREATE UNIQUE INDEX IF NOT EXISTS note_embeddings_meta_note_chunk ON note_embeddings_meta(note_id, chunk_index)',
|
||||
];
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
import { SqlQuery } from '../types';
|
||||
|
||||
// Recreate conflict_note_states with a numeric auto-increment primary key, to
|
||||
// match the convention used by the other tables. note_id keeps its uniqueness
|
||||
// through a UNIQUE constraint. The table was added in migration 51 and hasn't
|
||||
// shipped in a release yet, so it is safe to drop and recreate it rather than
|
||||
// migrate the rows
|
||||
|
||||
export default (): (SqlQuery|string)[] => {
|
||||
return [
|
||||
'DROP TABLE IF EXISTS conflict_note_states',
|
||||
`CREATE TABLE conflict_note_states (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
note_id TEXT NOT NULL UNIQUE,
|
||||
base_body TEXT NOT NULL DEFAULT "",
|
||||
base_title TEXT NOT NULL DEFAULT "",
|
||||
remote_body TEXT NOT NULL DEFAULT "",
|
||||
remote_title TEXT NOT NULL DEFAULT "",
|
||||
remote_updated_time INT NOT NULL DEFAULT 0
|
||||
)`,
|
||||
];
|
||||
};
|
||||
@@ -0,0 +1,25 @@
|
||||
import { SqlQuery } from '../types';
|
||||
|
||||
export default (): (SqlQuery|string)[] => {
|
||||
return [
|
||||
`CREATE TABLE chat_conversations (
|
||||
id TEXT PRIMARY KEY NOT NULL,
|
||||
title TEXT NOT NULL DEFAULT "",
|
||||
created_time INT NOT NULL,
|
||||
updated_time INT NOT NULL
|
||||
)`,
|
||||
`CREATE TABLE chat_messages (
|
||||
id TEXT PRIMARY KEY NOT NULL,
|
||||
conversation_id TEXT NOT NULL,
|
||||
role TEXT NOT NULL,
|
||||
text TEXT NOT NULL DEFAULT "",
|
||||
raw TEXT NOT NULL DEFAULT "[]",
|
||||
hide INT NOT NULL DEFAULT 0,
|
||||
position INT NOT NULL,
|
||||
created_time INT NOT NULL,
|
||||
note_id TEXT NOT NULL DEFAULT "",
|
||||
note_title TEXT NOT NULL DEFAULT ""
|
||||
)`,
|
||||
'CREATE UNIQUE INDEX chat_messages_conversation_position ON chat_messages (conversation_id, position)',
|
||||
];
|
||||
};
|
||||
@@ -0,0 +1,35 @@
|
||||
// AUTO-GENERATED using `gulp buildScriptIndexes`
|
||||
import migration42 from './42';
|
||||
import migration43 from './43';
|
||||
import migration44 from './44';
|
||||
import migration45 from './45';
|
||||
import migration46 from './46';
|
||||
import migration47 from './47';
|
||||
import migration48 from './48';
|
||||
import migration49 from './49';
|
||||
import migration50 from './50';
|
||||
import migration51 from './51';
|
||||
import migration52 from './52';
|
||||
import migration53 from './53';
|
||||
import migration54 from './54';
|
||||
|
||||
import { Migration } from '../types';
|
||||
|
||||
const index: Migration[] = [
|
||||
migration42,
|
||||
migration43,
|
||||
migration44,
|
||||
migration45,
|
||||
migration46,
|
||||
migration47,
|
||||
migration48,
|
||||
migration49,
|
||||
migration50,
|
||||
migration51,
|
||||
migration52,
|
||||
migration53,
|
||||
migration54,
|
||||
];
|
||||
|
||||
export default index;
|
||||
// AUTO-GENERATED using `gulp buildScriptIndexes`
|
||||
@@ -0,0 +1,17 @@
|
||||
export default (sql: string) => {
|
||||
const output = [];
|
||||
const lines = sql.split('\n');
|
||||
let statement = '';
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
const line = lines[i];
|
||||
if (line === '') continue;
|
||||
if (line.substr(0, 2) === '--') continue;
|
||||
statement += line.trim();
|
||||
if (line[line.length - 1] === ',') statement += ' ';
|
||||
if (line[line.length - 1] === ';') {
|
||||
output.push(statement);
|
||||
statement = '';
|
||||
}
|
||||
}
|
||||
return output;
|
||||
};
|
||||
@@ -0,0 +1,770 @@
|
||||
import { ModelType } from "../../BaseModel";
|
||||
|
||||
export interface BaseItemEntity {
|
||||
id?: string;
|
||||
encryption_applied?: number;
|
||||
extracted_resource_ids?: string;
|
||||
is_locked?: number;
|
||||
|
||||
// Means the item (note or resource) is published
|
||||
is_shared?: number;
|
||||
|
||||
// Means the item (note, folder or resource) is shared, as part of a shared
|
||||
// notebook
|
||||
share_id?: string;
|
||||
type_?: ModelType;
|
||||
updated_time?: number;
|
||||
created_time?: number;
|
||||
}
|
||||
|
||||
export type SqlParams = any[];
|
||||
|
||||
export interface SqlQuery {
|
||||
sql: string;
|
||||
params?: SqlParams;
|
||||
}
|
||||
|
||||
export type StringOrSqlQuery = string | SqlQuery;
|
||||
|
||||
export type Migration = () => (SqlQuery|string)[];
|
||||
|
||||
export enum FolderIconType {
|
||||
Emoji = 1,
|
||||
DataUrl = 2,
|
||||
FontAwesome = 3,
|
||||
}
|
||||
|
||||
export interface FolderIcon {
|
||||
type: FolderIconType;
|
||||
emoji: string;
|
||||
name: string;
|
||||
dataUrl: string;
|
||||
}
|
||||
|
||||
export const defaultFolderIcon = () => {
|
||||
const icon:FolderIcon = {
|
||||
type: FolderIconType.Emoji,
|
||||
emoji: '',
|
||||
name: '',
|
||||
dataUrl: '',
|
||||
};
|
||||
return icon;
|
||||
}
|
||||
|
||||
export interface UserDataValue {
|
||||
v: any; // value
|
||||
t: Number; // timestamp
|
||||
d?: Number; // deleted - 0 or 1 (default = 0)
|
||||
}
|
||||
|
||||
export enum ResourceOcrStatus {
|
||||
Todo = 0,
|
||||
Processing = 1,
|
||||
Done = 2,
|
||||
Error = 3,
|
||||
TodoAccessible = 4, // Like Todo, but requests full OCR details for accessible PDF creation
|
||||
}
|
||||
|
||||
export type UserData = Record<string, Record<string, UserDataValue>>;
|
||||
|
||||
interface DatabaseTableColumn {
|
||||
type: string;
|
||||
}
|
||||
|
||||
interface DatabaseTable {
|
||||
[key: string]: DatabaseTableColumn;
|
||||
}
|
||||
|
||||
interface DatabaseTables {
|
||||
[key: string]: DatabaseTable;
|
||||
}
|
||||
|
||||
export enum ResourceOcrDriverId {
|
||||
PrintedText = 1,
|
||||
HandwrittenText = 2,
|
||||
}
|
||||
|
||||
// AUTO-GENERATED BY packages/tools/generate-database-types.js
|
||||
|
||||
/*
|
||||
* This file was generated by a tool.
|
||||
* Rerun sql-ts to regenerate this file.
|
||||
*/
|
||||
export interface AlarmEntity {
|
||||
'id'?: number | null;
|
||||
'note_id'?: string;
|
||||
'trigger_time'?: number;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface ChatConversationEntity {
|
||||
'created_time'?: number;
|
||||
'id'?: string;
|
||||
'title'?: string;
|
||||
'updated_time'?: number;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface ChatMessageEntity {
|
||||
'conversation_id'?: string;
|
||||
'created_time'?: number;
|
||||
'hide'?: number;
|
||||
'id'?: string;
|
||||
'note_id'?: string;
|
||||
'note_title'?: string;
|
||||
'position'?: number;
|
||||
'raw'?: string;
|
||||
'role'?: string;
|
||||
'text'?: string;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface ConflictNoteStateEntity {
|
||||
'base_body'?: string;
|
||||
'base_title'?: string;
|
||||
'id'?: number | null;
|
||||
'note_id'?: string;
|
||||
'remote_body'?: string;
|
||||
'remote_title'?: string;
|
||||
'remote_updated_time'?: number;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface DeletedItemEntity {
|
||||
'deleted_time'?: number;
|
||||
'id'?: number | null;
|
||||
'item_id'?: string;
|
||||
'item_type'?: number;
|
||||
'sync_target'?: number;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface FolderEntity {
|
||||
'created_time'?: number;
|
||||
'deleted_time'?: number;
|
||||
'encryption_applied'?: number;
|
||||
'encryption_cipher_text'?: string;
|
||||
'icon'?: string;
|
||||
'id'?: string | null;
|
||||
'is_shared'?: number;
|
||||
'master_key_id'?: string;
|
||||
'parent_id'?: string;
|
||||
'share_id'?: string;
|
||||
'title'?: string;
|
||||
'updated_time'?: number;
|
||||
'user_created_time'?: number;
|
||||
'user_data'?: string;
|
||||
'user_updated_time'?: number;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface ItemChangeEntity {
|
||||
'before_change_item'?: string;
|
||||
'created_time'?: number;
|
||||
'id'?: number | null;
|
||||
'item_id'?: string;
|
||||
'item_type'?: number;
|
||||
'source'?: number;
|
||||
'type'?: number;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface ItemsFtEntity {
|
||||
'body'?: any | null;
|
||||
'id'?: any | null;
|
||||
'item_id'?: any | null;
|
||||
'item_type'?: any | null;
|
||||
'reserved1'?: any | null;
|
||||
'reserved2'?: any | null;
|
||||
'reserved3'?: any | null;
|
||||
'reserved4'?: any | null;
|
||||
'reserved5'?: any | null;
|
||||
'reserved6'?: any | null;
|
||||
'title'?: any | null;
|
||||
'user_updated_time'?: any | null;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface ItemsFtsDocsizeEntity {
|
||||
'docid'?: number | null;
|
||||
'size'?: any | null;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface ItemsFtsSegdirEntity {
|
||||
'end_block'?: number | null;
|
||||
'idx'?: number | null;
|
||||
'leaves_end_block'?: number | null;
|
||||
'level'?: number | null;
|
||||
'root'?: any | null;
|
||||
'start_block'?: number | null;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface ItemsFtsSegmentEntity {
|
||||
'block'?: any | null;
|
||||
'blockid'?: number | null;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface ItemsFtsStatEntity {
|
||||
'id'?: number | null;
|
||||
'value'?: any | null;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface ItemsNormalizedEntity {
|
||||
'body'?: string;
|
||||
'id'?: number | null;
|
||||
'item_id'?: string;
|
||||
'item_type'?: number;
|
||||
'reserved1'?: number | null;
|
||||
'reserved2'?: number | null;
|
||||
'reserved3'?: number | null;
|
||||
'reserved4'?: number | null;
|
||||
'reserved5'?: number | null;
|
||||
'reserved6'?: number | null;
|
||||
'title'?: string;
|
||||
'user_updated_time'?: number;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface KeyValueEntity {
|
||||
'id'?: number | null;
|
||||
'key'?: string;
|
||||
'type'?: number;
|
||||
'updated_time'?: number;
|
||||
'value'?: string;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface MigrationEntity {
|
||||
'created_time'?: number;
|
||||
'id'?: number | null;
|
||||
'number'?: number;
|
||||
'updated_time'?: number;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface NoteEmbeddingsMetaEntity {
|
||||
'chunk_index'?: number;
|
||||
'chunk_text'?: string;
|
||||
'created_time'?: number;
|
||||
'id'?: number | null;
|
||||
'model_id'?: string;
|
||||
'note_id'?: string;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface NoteResourceEntity {
|
||||
'id'?: number | null;
|
||||
'is_associated'?: number;
|
||||
'last_seen_time'?: number;
|
||||
'note_id'?: string;
|
||||
'resource_id'?: string;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface NoteTagEntity {
|
||||
'created_time'?: number;
|
||||
'encryption_applied'?: number;
|
||||
'encryption_cipher_text'?: string;
|
||||
'id'?: string | null;
|
||||
'is_shared'?: number;
|
||||
'note_id'?: string;
|
||||
'tag_id'?: string;
|
||||
'updated_time'?: number;
|
||||
'user_created_time'?: number;
|
||||
'user_updated_time'?: number;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface NoteEntity {
|
||||
'altitude'?: number;
|
||||
'application_data'?: string;
|
||||
'author'?: string;
|
||||
'body'?: string;
|
||||
'conflict_original_id'?: string;
|
||||
'created_time'?: number;
|
||||
'deleted_time'?: number;
|
||||
'encryption_applied'?: number;
|
||||
'encryption_cipher_text'?: string;
|
||||
'extracted_resource_ids'?: string;
|
||||
'id'?: string | null;
|
||||
'is_conflict'?: number;
|
||||
'is_locked'?: number;
|
||||
'is_shared'?: number;
|
||||
'is_todo'?: number;
|
||||
'latitude'?: number;
|
||||
'longitude'?: number;
|
||||
'markup_language'?: number;
|
||||
'master_key_id'?: string;
|
||||
'order'?: number;
|
||||
'parent_id'?: string;
|
||||
'share_id'?: string;
|
||||
'source'?: string;
|
||||
'source_application'?: string;
|
||||
'source_url'?: string;
|
||||
'title'?: string;
|
||||
'todo_completed'?: number;
|
||||
'todo_due'?: number;
|
||||
'updated_time'?: number;
|
||||
'user_created_time'?: number;
|
||||
'user_data'?: string;
|
||||
'user_updated_time'?: number;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface NotesNormalizedEntity {
|
||||
'altitude'?: number;
|
||||
'body'?: string;
|
||||
'id'?: string;
|
||||
'is_todo'?: number;
|
||||
'latitude'?: number;
|
||||
'longitude'?: number;
|
||||
'parent_id'?: string;
|
||||
'source_url'?: string;
|
||||
'title'?: string;
|
||||
'todo_completed'?: number;
|
||||
'todo_due'?: number;
|
||||
'user_created_time'?: number;
|
||||
'user_updated_time'?: number;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface ResourceLocalStateEntity {
|
||||
'fetch_error'?: string;
|
||||
'fetch_status'?: number;
|
||||
'id'?: number | null;
|
||||
'resource_id'?: string;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface ResourceEntity {
|
||||
'blob_updated_time'?: number;
|
||||
'created_time'?: number;
|
||||
'encryption_applied'?: number;
|
||||
'encryption_blob_encrypted'?: number;
|
||||
'encryption_cipher_text'?: string;
|
||||
'file_extension'?: string;
|
||||
'filename'?: string;
|
||||
'id'?: string | null;
|
||||
'is_locked'?: number;
|
||||
'is_shared'?: number;
|
||||
'master_key_id'?: string;
|
||||
'mime'?: string;
|
||||
'ocr_details'?: string;
|
||||
'ocr_driver_id'?: number;
|
||||
'ocr_error'?: string;
|
||||
'ocr_status'?: number;
|
||||
'ocr_text'?: string;
|
||||
'share_id'?: string;
|
||||
'size'?: number;
|
||||
'title'?: string;
|
||||
'updated_time'?: number;
|
||||
'user_created_time'?: number;
|
||||
'user_data'?: string;
|
||||
'user_updated_time'?: number;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface ResourcesToDownloadEntity {
|
||||
'created_time'?: number;
|
||||
'id'?: number | null;
|
||||
'resource_id'?: string;
|
||||
'updated_time'?: number;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface RevisionEntity {
|
||||
'body_diff'?: string;
|
||||
'created_time'?: number;
|
||||
'encryption_applied'?: number;
|
||||
'encryption_cipher_text'?: string;
|
||||
'id'?: string | null;
|
||||
'is_locked'?: number;
|
||||
'item_id'?: string;
|
||||
'item_type'?: number;
|
||||
'item_updated_time'?: number;
|
||||
'metadata_diff'?: string;
|
||||
'parent_id'?: string;
|
||||
'title_diff'?: string;
|
||||
'updated_time'?: number;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface SettingEntity {
|
||||
'key'?: string | null;
|
||||
'value'?: string | null;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface SyncItemEntity {
|
||||
'base_body'?: string;
|
||||
'base_conflict_note_id'?: string;
|
||||
'base_title'?: string;
|
||||
'force_sync'?: number;
|
||||
'id'?: number | null;
|
||||
'item_id'?: string;
|
||||
'item_location'?: number;
|
||||
'item_type'?: number;
|
||||
'remote_item_updated_time'?: number;
|
||||
'sync_disabled'?: number;
|
||||
'sync_disabled_reason'?: string;
|
||||
'sync_target'?: number;
|
||||
'sync_time'?: number;
|
||||
'sync_warning_ignored'?: number;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface TableFieldEntity {
|
||||
'field_default'?: string | null;
|
||||
'field_name'?: string;
|
||||
'field_type'?: number;
|
||||
'id'?: number | null;
|
||||
'table_name'?: string;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface TagEntity {
|
||||
'created_time'?: number;
|
||||
'encryption_applied'?: number;
|
||||
'encryption_cipher_text'?: string;
|
||||
'id'?: string | null;
|
||||
'is_shared'?: number;
|
||||
'parent_id'?: string;
|
||||
'title'?: string;
|
||||
'updated_time'?: number;
|
||||
'user_created_time'?: number;
|
||||
'user_data'?: string;
|
||||
'user_updated_time'?: number;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface TagsWithNoteCountEntity {
|
||||
'created_time'?: number | null;
|
||||
'id'?: string | null;
|
||||
'note_count'?: any | null;
|
||||
'title'?: string | null;
|
||||
'todo_completed_count'?: any | null;
|
||||
'updated_time'?: number | null;
|
||||
'type_'?: number;
|
||||
}
|
||||
export interface VersionEntity {
|
||||
'table_fields_version'?: number;
|
||||
'version'?: number;
|
||||
'type_'?: number;
|
||||
}
|
||||
|
||||
|
||||
export const databaseSchema: DatabaseTables = {
|
||||
folders: {
|
||||
created_time: { type: 'number' },
|
||||
deleted_time: { type: 'number' },
|
||||
encryption_applied: { type: 'number' },
|
||||
encryption_cipher_text: { type: 'string' },
|
||||
icon: { type: 'string' },
|
||||
id: { type: 'string' },
|
||||
is_shared: { type: 'number' },
|
||||
master_key_id: { type: 'string' },
|
||||
parent_id: { type: 'string' },
|
||||
share_id: { type: 'string' },
|
||||
title: { type: 'string' },
|
||||
updated_time: { type: 'number' },
|
||||
user_created_time: { type: 'number' },
|
||||
user_data: { type: 'string' },
|
||||
user_updated_time: { type: 'number' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
tags: {
|
||||
created_time: { type: 'number' },
|
||||
encryption_applied: { type: 'number' },
|
||||
encryption_cipher_text: { type: 'string' },
|
||||
id: { type: 'string' },
|
||||
is_shared: { type: 'number' },
|
||||
parent_id: { type: 'string' },
|
||||
title: { type: 'string' },
|
||||
updated_time: { type: 'number' },
|
||||
user_created_time: { type: 'number' },
|
||||
user_data: { type: 'string' },
|
||||
user_updated_time: { type: 'number' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
note_tags: {
|
||||
created_time: { type: 'number' },
|
||||
encryption_applied: { type: 'number' },
|
||||
encryption_cipher_text: { type: 'string' },
|
||||
id: { type: 'string' },
|
||||
is_shared: { type: 'number' },
|
||||
note_id: { type: 'string' },
|
||||
tag_id: { type: 'string' },
|
||||
updated_time: { type: 'number' },
|
||||
user_created_time: { type: 'number' },
|
||||
user_updated_time: { type: 'number' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
table_fields: {
|
||||
field_default: { type: 'string' },
|
||||
field_name: { type: 'string' },
|
||||
field_type: { type: 'number' },
|
||||
id: { type: 'number' },
|
||||
table_name: { type: 'string' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
sync_items: {
|
||||
base_body: { type: 'string' },
|
||||
base_conflict_note_id: { type: 'string' },
|
||||
base_title: { type: 'string' },
|
||||
force_sync: { type: 'number' },
|
||||
id: { type: 'number' },
|
||||
item_id: { type: 'string' },
|
||||
item_location: { type: 'number' },
|
||||
item_type: { type: 'number' },
|
||||
remote_item_updated_time: { type: 'number' },
|
||||
sync_disabled: { type: 'number' },
|
||||
sync_disabled_reason: { type: 'string' },
|
||||
sync_target: { type: 'number' },
|
||||
sync_time: { type: 'number' },
|
||||
sync_warning_ignored: { type: 'number' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
version: {
|
||||
table_fields_version: { type: 'number' },
|
||||
version: { type: 'number' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
deleted_items: {
|
||||
deleted_time: { type: 'number' },
|
||||
id: { type: 'number' },
|
||||
item_id: { type: 'string' },
|
||||
item_type: { type: 'number' },
|
||||
sync_target: { type: 'number' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
settings: {
|
||||
key: { type: 'string' },
|
||||
value: { type: 'string' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
alarms: {
|
||||
id: { type: 'number' },
|
||||
note_id: { type: 'string' },
|
||||
trigger_time: { type: 'number' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
item_changes: {
|
||||
before_change_item: { type: 'string' },
|
||||
created_time: { type: 'number' },
|
||||
id: { type: 'number' },
|
||||
item_id: { type: 'string' },
|
||||
item_type: { type: 'number' },
|
||||
source: { type: 'number' },
|
||||
type: { type: 'number' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
note_resources: {
|
||||
id: { type: 'number' },
|
||||
is_associated: { type: 'number' },
|
||||
last_seen_time: { type: 'number' },
|
||||
note_id: { type: 'string' },
|
||||
resource_id: { type: 'string' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
resource_local_states: {
|
||||
fetch_error: { type: 'string' },
|
||||
fetch_status: { type: 'number' },
|
||||
id: { type: 'number' },
|
||||
resource_id: { type: 'string' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
resources: {
|
||||
blob_updated_time: { type: 'number' },
|
||||
created_time: { type: 'number' },
|
||||
encryption_applied: { type: 'number' },
|
||||
encryption_blob_encrypted: { type: 'number' },
|
||||
encryption_cipher_text: { type: 'string' },
|
||||
file_extension: { type: 'string' },
|
||||
filename: { type: 'string' },
|
||||
id: { type: 'string' },
|
||||
is_locked: { type: 'number' },
|
||||
is_shared: { type: 'number' },
|
||||
master_key_id: { type: 'string' },
|
||||
mime: { type: 'string' },
|
||||
ocr_details: { type: 'string' },
|
||||
ocr_driver_id: { type: 'number' },
|
||||
ocr_error: { type: 'string' },
|
||||
ocr_status: { type: 'number' },
|
||||
ocr_text: { type: 'string' },
|
||||
share_id: { type: 'string' },
|
||||
size: { type: 'number' },
|
||||
title: { type: 'string' },
|
||||
updated_time: { type: 'number' },
|
||||
user_created_time: { type: 'number' },
|
||||
user_data: { type: 'string' },
|
||||
user_updated_time: { type: 'number' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
revisions: {
|
||||
body_diff: { type: 'string' },
|
||||
created_time: { type: 'number' },
|
||||
encryption_applied: { type: 'number' },
|
||||
encryption_cipher_text: { type: 'string' },
|
||||
id: { type: 'string' },
|
||||
is_locked: { type: 'number' },
|
||||
item_id: { type: 'string' },
|
||||
item_type: { type: 'number' },
|
||||
item_updated_time: { type: 'number' },
|
||||
metadata_diff: { type: 'string' },
|
||||
parent_id: { type: 'string' },
|
||||
title_diff: { type: 'string' },
|
||||
updated_time: { type: 'number' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
migrations: {
|
||||
created_time: { type: 'number' },
|
||||
id: { type: 'number' },
|
||||
number: { type: 'number' },
|
||||
updated_time: { type: 'number' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
resources_to_download: {
|
||||
created_time: { type: 'number' },
|
||||
id: { type: 'number' },
|
||||
resource_id: { type: 'string' },
|
||||
updated_time: { type: 'number' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
key_values: {
|
||||
id: { type: 'number' },
|
||||
key: { type: 'string' },
|
||||
type: { type: 'number' },
|
||||
updated_time: { type: 'number' },
|
||||
value: { type: 'string' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
notes: {
|
||||
altitude: { type: 'number' },
|
||||
application_data: { type: 'string' },
|
||||
author: { type: 'string' },
|
||||
body: { type: 'string' },
|
||||
conflict_original_id: { type: 'string' },
|
||||
created_time: { type: 'number' },
|
||||
deleted_time: { type: 'number' },
|
||||
encryption_applied: { type: 'number' },
|
||||
encryption_cipher_text: { type: 'string' },
|
||||
extracted_resource_ids: { type: 'string' },
|
||||
id: { type: 'string' },
|
||||
is_conflict: { type: 'number' },
|
||||
is_locked: { type: 'number' },
|
||||
is_shared: { type: 'number' },
|
||||
is_todo: { type: 'number' },
|
||||
latitude: { type: 'number' },
|
||||
longitude: { type: 'number' },
|
||||
markup_language: { type: 'number' },
|
||||
master_key_id: { type: 'string' },
|
||||
order: { type: 'number' },
|
||||
parent_id: { type: 'string' },
|
||||
share_id: { type: 'string' },
|
||||
source: { type: 'string' },
|
||||
source_application: { type: 'string' },
|
||||
source_url: { type: 'string' },
|
||||
title: { type: 'string' },
|
||||
todo_completed: { type: 'number' },
|
||||
todo_due: { type: 'number' },
|
||||
updated_time: { type: 'number' },
|
||||
user_created_time: { type: 'number' },
|
||||
user_data: { type: 'string' },
|
||||
user_updated_time: { type: 'number' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
notes_normalized: {
|
||||
altitude: { type: 'number' },
|
||||
body: { type: 'string' },
|
||||
id: { type: 'string' },
|
||||
is_todo: { type: 'number' },
|
||||
latitude: { type: 'number' },
|
||||
longitude: { type: 'number' },
|
||||
parent_id: { type: 'string' },
|
||||
source_url: { type: 'string' },
|
||||
title: { type: 'string' },
|
||||
todo_completed: { type: 'number' },
|
||||
todo_due: { type: 'number' },
|
||||
user_created_time: { type: 'number' },
|
||||
user_updated_time: { type: 'number' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
items_normalized: {
|
||||
body: { type: 'string' },
|
||||
id: { type: 'number' },
|
||||
item_id: { type: 'string' },
|
||||
item_type: { type: 'number' },
|
||||
reserved1: { type: 'number' },
|
||||
reserved2: { type: 'number' },
|
||||
reserved3: { type: 'number' },
|
||||
reserved4: { type: 'number' },
|
||||
reserved5: { type: 'number' },
|
||||
reserved6: { type: 'number' },
|
||||
title: { type: 'string' },
|
||||
user_updated_time: { type: 'number' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
items_fts: {
|
||||
body: { type: 'any' },
|
||||
id: { type: 'any' },
|
||||
item_id: { type: 'any' },
|
||||
item_type: { type: 'any' },
|
||||
reserved1: { type: 'any' },
|
||||
reserved2: { type: 'any' },
|
||||
reserved3: { type: 'any' },
|
||||
reserved4: { type: 'any' },
|
||||
reserved5: { type: 'any' },
|
||||
reserved6: { type: 'any' },
|
||||
title: { type: 'any' },
|
||||
user_updated_time: { type: 'any' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
items_fts_segments: {
|
||||
block: { type: 'any' },
|
||||
blockid: { type: 'number' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
items_fts_segdir: {
|
||||
end_block: { type: 'number' },
|
||||
idx: { type: 'number' },
|
||||
leaves_end_block: { type: 'number' },
|
||||
level: { type: 'number' },
|
||||
root: { type: 'any' },
|
||||
start_block: { type: 'number' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
items_fts_docsize: {
|
||||
docid: { type: 'number' },
|
||||
size: { type: 'any' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
items_fts_stat: {
|
||||
id: { type: 'number' },
|
||||
value: { type: 'any' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
tags_with_note_count: {
|
||||
created_time: { type: 'number' },
|
||||
id: { type: 'string' },
|
||||
note_count: { type: 'any' },
|
||||
title: { type: 'string' },
|
||||
todo_completed_count: { type: 'any' },
|
||||
updated_time: { type: 'number' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
note_embeddings_meta: {
|
||||
chunk_index: { type: 'number' },
|
||||
chunk_text: { type: 'string' },
|
||||
created_time: { type: 'number' },
|
||||
id: { type: 'number' },
|
||||
model_id: { type: 'string' },
|
||||
note_id: { type: 'string' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
conflict_note_states: {
|
||||
base_body: { type: 'string' },
|
||||
base_title: { type: 'string' },
|
||||
id: { type: 'number' },
|
||||
note_id: { type: 'string' },
|
||||
remote_body: { type: 'string' },
|
||||
remote_title: { type: 'string' },
|
||||
remote_updated_time: { type: 'number' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
chat_conversations: {
|
||||
created_time: { type: 'number' },
|
||||
id: { type: 'string' },
|
||||
title: { type: 'string' },
|
||||
updated_time: { type: 'number' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
chat_messages: {
|
||||
conversation_id: { type: 'string' },
|
||||
created_time: { type: 'number' },
|
||||
hide: { type: 'number' },
|
||||
id: { type: 'string' },
|
||||
note_id: { type: 'string' },
|
||||
note_title: { type: 'string' },
|
||||
position: { type: 'number' },
|
||||
raw: { type: 'string' },
|
||||
role: { type: 'string' },
|
||||
text: { type: 'string' },
|
||||
type_: { type: 'number' },
|
||||
},
|
||||
};
|
||||
在新工单中引用
屏蔽一个用户