mirror of
https://github.com/laurent22/joplin.git
synced 2024-11-27 08:21:03 +02:00
39 lines
887 B
JavaScript
39 lines
887 B
JavaScript
const BaseSyncTarget = require('lib/BaseSyncTarget.js');
|
|
const { _ } = require('lib/locale.js');
|
|
const Setting = require('lib/models/Setting.js');
|
|
const { FileApi } = require('lib/file-api.js');
|
|
const { FileApiDriverMemory } = require('lib/file-api-driver-memory.js');
|
|
const { Synchronizer } = require('lib/synchronizer.js');
|
|
|
|
class SyncTargetMemory extends BaseSyncTarget {
|
|
|
|
static id() {
|
|
return 1;
|
|
}
|
|
|
|
static targetName() {
|
|
return 'memory';
|
|
}
|
|
|
|
static label() {
|
|
return 'Memory';
|
|
}
|
|
|
|
async isAuthenticated() {
|
|
return true;
|
|
}
|
|
|
|
initFileApi() {
|
|
const fileApi = new FileApi('/root', new FileApiDriverMemory());
|
|
fileApi.setLogger(this.logger());
|
|
fileApi.setSyncTargetId(SyncTargetMemory.id());
|
|
return fileApi;
|
|
}
|
|
|
|
async initSynchronizer() {
|
|
return new Synchronizer(this.db(), await this.fileApi(), Setting.value('appType'));
|
|
}
|
|
|
|
}
|
|
|
|
module.exports = SyncTargetMemory; |