1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-23 22:36:32 +02:00

Desktop: Add OneNote Importer (#11392)

This commit is contained in:
pedr
2024-11-17 13:21:08 -03:00
committed by GitHub
parent e36f37707f
commit 4d7fa5972f
194 changed files with 15920 additions and 14 deletions

View File

@@ -1,11 +1,11 @@
import paginationToSql from './models/utils/paginationToSql';
import Database from './database';
import uuid from './uuid';
import time from './time';
import JoplinDatabase, { TableField } from './JoplinDatabase';
import { LoadOptions, SaveOptions } from './models/utils/types';
import ActionLogger, { ItemActionType as ItemActionType } from './utils/ActionLogger';
import { BaseItemEntity, SqlQuery } from './services/database/types';
import uuid from './uuid';
const Mutex = require('async-mutex').Mutex;
// New code should make use of this enum
@@ -80,6 +80,8 @@ class BaseModel {
['TYPE_COMMAND', ModelType.Command],
];
private static uuidGenerator: ()=> string = uuid.create;
public static TYPE_NOTE = ModelType.Note;
public static TYPE_FOLDER = ModelType.Folder;
public static TYPE_SETTING = ModelType.Setting;
@@ -576,7 +578,7 @@ class BaseModel {
if (options.isNew) {
if (this.useUuid() && !o.id) {
modelId = uuid.create();
modelId = this.generateUuid();
o.id = modelId;
}
@@ -757,6 +759,15 @@ class BaseModel {
return this.db_;
}
public static generateUuid() {
return this.uuidGenerator();
}
public static setIdGenerator(generator: ()=> string) {
const previous = this.uuidGenerator;
this.uuidGenerator = generator;
return previous;
}
// static isReady() {
// return !!this.db_;
// }