1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-21 09:38:01 +02:00

Chore: Migrate file system sync to TypeScript (#10361)

This commit is contained in:
Henry Heino 2024-04-25 05:31:48 -07:00 committed by GitHub
parent c7c4371902
commit 83b50aaa8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 124 additions and 84 deletions

View File

@ -777,6 +777,7 @@ packages/lib/ObjectUtils.js
packages/lib/PoorManIntervals.js packages/lib/PoorManIntervals.js
packages/lib/RotatingLogs.test.js packages/lib/RotatingLogs.test.js
packages/lib/RotatingLogs.js packages/lib/RotatingLogs.js
packages/lib/SyncTargetFilesystem.js
packages/lib/SyncTargetJoplinCloud.js packages/lib/SyncTargetJoplinCloud.js
packages/lib/SyncTargetJoplinServer.js packages/lib/SyncTargetJoplinServer.js
packages/lib/SyncTargetNone.js packages/lib/SyncTargetNone.js
@ -816,6 +817,7 @@ packages/lib/errorUtils.js
packages/lib/errors.js packages/lib/errors.js
packages/lib/eventManager.js packages/lib/eventManager.js
packages/lib/file-api-driver-joplinServer.js packages/lib/file-api-driver-joplinServer.js
packages/lib/file-api-driver-local.js
packages/lib/file-api-driver-memory.js packages/lib/file-api-driver-memory.js
packages/lib/file-api-driver.test.js packages/lib/file-api-driver.test.js
packages/lib/file-api.test.js packages/lib/file-api.test.js

2
.gitignore vendored
View File

@ -757,6 +757,7 @@ packages/lib/ObjectUtils.js
packages/lib/PoorManIntervals.js packages/lib/PoorManIntervals.js
packages/lib/RotatingLogs.test.js packages/lib/RotatingLogs.test.js
packages/lib/RotatingLogs.js packages/lib/RotatingLogs.js
packages/lib/SyncTargetFilesystem.js
packages/lib/SyncTargetJoplinCloud.js packages/lib/SyncTargetJoplinCloud.js
packages/lib/SyncTargetJoplinServer.js packages/lib/SyncTargetJoplinServer.js
packages/lib/SyncTargetNone.js packages/lib/SyncTargetNone.js
@ -796,6 +797,7 @@ packages/lib/errorUtils.js
packages/lib/errors.js packages/lib/errors.js
packages/lib/eventManager.js packages/lib/eventManager.js
packages/lib/file-api-driver-joplinServer.js packages/lib/file-api-driver-joplinServer.js
packages/lib/file-api-driver-local.js
packages/lib/file-api-driver-memory.js packages/lib/file-api-driver-memory.js
packages/lib/file-api-driver.test.js packages/lib/file-api-driver.test.js
packages/lib/file-api.test.js packages/lib/file-api.test.js

View File

@ -26,7 +26,7 @@ const sharp = require('sharp');
const { shimInit } = require('@joplin/lib/shim-init-node.js'); const { shimInit } = require('@joplin/lib/shim-init-node.js');
const shim = require('@joplin/lib/shim').default; const shim = require('@joplin/lib/shim').default;
const { _ } = require('@joplin/lib/locale'); const { _ } = require('@joplin/lib/locale');
const { FileApiDriverLocal } = require('@joplin/lib/file-api-driver-local'); const FileApiDriverLocal = require('@joplin/lib/file-api-driver-local').default;
const EncryptionService = require('@joplin/lib/services/e2ee/EncryptionService').default; const EncryptionService = require('@joplin/lib/services/e2ee/EncryptionService').default;
const envFromArgs = require('@joplin/lib/envFromArgs'); const envFromArgs = require('@joplin/lib/envFromArgs');
const nodeSqlite = require('sqlite3'); const nodeSqlite = require('sqlite3');

View File

@ -26,7 +26,7 @@ const shim = require('@joplin/lib/shim').default;
const { shimInit } = require('@joplin/lib/shim-init-node.js'); const { shimInit } = require('@joplin/lib/shim-init-node.js');
const bridge = require('@electron/remote').require('./bridge').default; const bridge = require('@electron/remote').require('./bridge').default;
const EncryptionService = require('@joplin/lib/services/e2ee/EncryptionService').default; const EncryptionService = require('@joplin/lib/services/e2ee/EncryptionService').default;
const { FileApiDriverLocal } = require('@joplin/lib/file-api-driver-local'); const FileApiDriverLocal = require('@joplin/lib/file-api-driver-local').default;
const React = require('react'); const React = require('react');
const nodeSqlite = require('sqlite3'); const nodeSqlite = require('sqlite3');
const initLib = require('@joplin/lib/initLib').default; const initLib = require('@joplin/lib/initLib').default;

View File

@ -72,13 +72,13 @@ const { SideMenuContentNote } = require('./components/side-menu-content-note.js'
const { DatabaseDriverReactNative } = require('./utils/database-driver-react-native'); const { DatabaseDriverReactNative } = require('./utils/database-driver-react-native');
import { reg } from '@joplin/lib/registry'; import { reg } from '@joplin/lib/registry';
const { defaultState } = require('@joplin/lib/reducer'); const { defaultState } = require('@joplin/lib/reducer');
const { FileApiDriverLocal } = require('@joplin/lib/file-api-driver-local'); import FileApiDriverLocal from '@joplin/lib/file-api-driver-local';
import ResourceFetcher from '@joplin/lib/services/ResourceFetcher'; import ResourceFetcher from '@joplin/lib/services/ResourceFetcher';
import SearchEngine from '@joplin/lib/services/search/SearchEngine'; import SearchEngine from '@joplin/lib/services/search/SearchEngine';
import WelcomeUtils from '@joplin/lib/WelcomeUtils'; import WelcomeUtils from '@joplin/lib/WelcomeUtils';
import { themeStyle } from './components/global-style'; import { themeStyle } from './components/global-style';
import SyncTargetRegistry from '@joplin/lib/SyncTargetRegistry'; import SyncTargetRegistry from '@joplin/lib/SyncTargetRegistry';
const SyncTargetFilesystem = require('@joplin/lib/SyncTargetFilesystem.js'); import SyncTargetFilesystem from '@joplin/lib/SyncTargetFilesystem';
const SyncTargetNextcloud = require('@joplin/lib/SyncTargetNextcloud.js'); const SyncTargetNextcloud = require('@joplin/lib/SyncTargetNextcloud.js');
const SyncTargetWebDAV = require('@joplin/lib/SyncTargetWebDAV.js'); const SyncTargetWebDAV = require('@joplin/lib/SyncTargetWebDAV.js');
const SyncTargetDropbox = require('@joplin/lib/SyncTargetDropbox.js'); const SyncTargetDropbox = require('@joplin/lib/SyncTargetDropbox.js');

View File

@ -30,7 +30,7 @@ import fs = require('fs-extra');
const EventEmitter = require('events'); const EventEmitter = require('events');
const syswidecas = require('./vendor/syswide-cas'); const syswidecas = require('./vendor/syswide-cas');
import SyncTargetRegistry from './SyncTargetRegistry'; import SyncTargetRegistry from './SyncTargetRegistry';
const SyncTargetFilesystem = require('./SyncTargetFilesystem.js'); import SyncTargetFilesystem from './SyncTargetFilesystem';
const SyncTargetNextcloud = require('./SyncTargetNextcloud.js'); const SyncTargetNextcloud = require('./SyncTargetNextcloud.js');
const SyncTargetWebDAV = require('./SyncTargetWebDAV.js'); const SyncTargetWebDAV = require('./SyncTargetWebDAV.js');
const SyncTargetDropbox = require('./SyncTargetDropbox.js'); const SyncTargetDropbox = require('./SyncTargetDropbox.js');

View File

@ -1,44 +0,0 @@
const BaseSyncTarget = require('./BaseSyncTarget').default;
const { _ } = require('./locale');
const Setting = require('./models/Setting').default;
const { FileApi } = require('./file-api.js');
const { FileApiDriverLocal } = require('./file-api-driver-local');
const Synchronizer = require('./Synchronizer').default;
class SyncTargetFilesystem extends BaseSyncTarget {
static id() {
return 2;
}
static targetName() {
return 'filesystem';
}
static label() {
return _('File system');
}
static unsupportedPlatforms() {
return ['ios'];
}
async isAuthenticated() {
return true;
}
async initFileApi() {
const syncPath = Setting.value('sync.2.path');
const driver = new FileApiDriverLocal();
const fileApi = new FileApi(syncPath, driver);
fileApi.setLogger(this.logger());
fileApi.setSyncTargetId(SyncTargetFilesystem.id());
await driver.mkdir(syncPath);
return fileApi;
}
async initSynchronizer() {
return new Synchronizer(this.db(), await this.fileApi(), Setting.value('appType'));
}
}
module.exports = SyncTargetFilesystem;

View File

@ -0,0 +1,43 @@
import BaseSyncTarget from './BaseSyncTarget';
import { _ } from './locale';
import Setting from './models/Setting';
import { FileApi } from './file-api';
import FileApiDriverLocal from './file-api-driver-local';
import Synchronizer from './Synchronizer';
export default class SyncTargetFilesystem extends BaseSyncTarget {
public static id() {
return 2;
}
public static targetName() {
return 'filesystem';
}
public static label() {
return _('File system');
}
public static unsupportedPlatforms() {
return ['ios'];
}
public async isAuthenticated() {
return true;
}
public async initFileApi() {
const syncPath = Setting.value('sync.2.path');
const driver = new FileApiDriverLocal();
const fileApi = new FileApi(syncPath, driver);
fileApi.setLogger(this.logger());
fileApi.setSyncTargetId(SyncTargetFilesystem.id());
await driver.mkdir(syncPath);
return fileApi;
}
public async initSynchronizer() {
return new Synchronizer(this.db(), await this.fileApi(), Setting.value('appType'));
}
}

View File

@ -1,4 +1,7 @@
const { basicDelta } = require('./file-api'); import JoplinError from './JoplinError';
import { DeltaOptions, GetOptions, ItemStat, PutOptions, basicDelta } from './file-api';
import FsDriverBase, { Stat } from './fs-driver-base';
// NOTE: when synchronising with the file system the time resolution is the second (unlike milliseconds for OneDrive for instance). // NOTE: when synchronising with the file system the time resolution is the second (unlike milliseconds for OneDrive for instance).
// What it means is that if, for example, client 1 changes a note at time t, and client 2 changes the same note within the same second, // What it means is that if, for example, client 1 changes a note at time t, and client 2 changes the same note within the same second,
@ -13,21 +16,24 @@ const { basicDelta } = require('./file-api');
// check that it is indeed the problem, check log-database.txt of both clients, search for the note ID, and most likely both notes // check that it is indeed the problem, check log-database.txt of both clients, search for the note ID, and most likely both notes
// will have been modified at the same exact second at some point. If not, it's another bug that needs to be investigated. // will have been modified at the same exact second at some point. If not, it's another bug that needs to be investigated.
class FileApiDriverLocal { export default class FileApiDriverLocal {
fsErrorToJsError_(error, path = null) { public static fsDriver_: FsDriverBase;
private fsErrorToJsError_(error: JoplinError, path: string|null = null) {
let msg = error.toString(); let msg = error.toString();
if (path !== null) msg += `. Path: ${path}`; if (path !== null) msg += `. Path: ${path}`;
const output = new Error(msg); // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Partial refactor of old coe from before rule was applied
const output: any = new Error(msg);
if (error.code) output.code = error.code; if (error.code) output.code = error.code;
return output; return output;
} }
fsDriver() { public fsDriver() {
if (!FileApiDriverLocal.fsDriver_) { throw new Error('FileApiDriverLocal.fsDriver_ not set!'); } if (!FileApiDriverLocal.fsDriver_) { throw new Error('FileApiDriverLocal.fsDriver_ not set!'); }
return FileApiDriverLocal.fsDriver_; return FileApiDriverLocal.fsDriver_;
} }
async stat(path) { public async stat(path: string) {
try { try {
const s = await this.fsDriver().stat(path); const s = await this.fsDriver().stat(path);
if (!s) return null; if (!s) return null;
@ -37,7 +43,7 @@ class FileApiDriverLocal {
} }
} }
metadataFromStat_(stat) { private metadataFromStat_(stat: Stat): ItemStat {
return { return {
path: stat.path, path: stat.path,
// created_time: stat.birthtime.getTime(), // created_time: stat.birthtime.getTime(),
@ -46,7 +52,7 @@ class FileApiDriverLocal {
}; };
} }
metadataFromStats_(stats) { private metadataFromStats_(stats: Stat[]): ItemStat[] {
const output = []; const output = [];
for (let i = 0; i < stats.length; i++) { for (let i = 0; i < stats.length; i++) {
const mdStat = this.metadataFromStat_(stats[i]); const mdStat = this.metadataFromStat_(stats[i]);
@ -55,7 +61,7 @@ class FileApiDriverLocal {
return output; return output;
} }
async setTimestamp(path, timestampMs) { public async setTimestamp(path: string, timestampMs: number) {
try { try {
await this.fsDriver().setTimestamp(path, new Date(timestampMs)); await this.fsDriver().setTimestamp(path, new Date(timestampMs));
} catch (error) { } catch (error) {
@ -63,8 +69,8 @@ class FileApiDriverLocal {
} }
} }
async delta(path, options) { public async delta(path: string, options: DeltaOptions) {
const getStatFn = async path => { const getStatFn = async (path: string) => {
const stats = await this.fsDriver().readDirStats(path); const stats = await this.fsDriver().readDirStats(path);
return this.metadataFromStats_(stats); return this.metadataFromStats_(stats);
}; };
@ -77,7 +83,7 @@ class FileApiDriverLocal {
} }
} }
async list(path) { public async list(path: string) {
try { try {
const stats = await this.fsDriver().readDirStats(path); const stats = await this.fsDriver().readDirStats(path);
const output = this.metadataFromStats_(stats); const output = this.metadataFromStats_(stats);
@ -85,14 +91,14 @@ class FileApiDriverLocal {
return { return {
items: output, items: output,
hasMore: false, hasMore: false,
context: null, context: null as unknown,
}; };
} catch (error) { } catch (error) {
throw this.fsErrorToJsError_(error, path); throw this.fsErrorToJsError_(error, path);
} }
} }
async get(path, options) { public async get(path: string, options: GetOptions) {
if (!options) options = {}; if (!options) options = {};
let output = null; let output = null;
@ -112,7 +118,7 @@ class FileApiDriverLocal {
return output; return output;
} }
async mkdir(path) { public async mkdir(path: string) {
if (await this.fsDriver().exists(path)) return; if (await this.fsDriver().exists(path)) return;
try { try {
@ -139,7 +145,7 @@ class FileApiDriverLocal {
// }); // });
} }
async put(path, content, options = null) { public async put(path: string, content: string, options: PutOptions = null) {
if (!options) options = {}; if (!options) options = {};
try { try {
@ -167,7 +173,7 @@ class FileApiDriverLocal {
// }); // });
} }
async delete(path) { public async delete(path: string) {
try { try {
await this.fsDriver().unlink(path); await this.fsDriver().unlink(path);
} catch (error) { } catch (error) {
@ -190,7 +196,7 @@ class FileApiDriverLocal {
// }); // });
} }
async move(oldPath, newPath) { public async move(oldPath: string, newPath: string) {
try { try {
await this.fsDriver().move(oldPath, newPath); await this.fsDriver().move(oldPath, newPath);
} catch (error) { } catch (error) {
@ -218,11 +224,11 @@ class FileApiDriverLocal {
// throw lastError; // throw lastError;
} }
format() { public format() {
throw new Error('Not supported'); throw new Error('Not supported');
} }
async clearRoot(baseDir) { public async clearRoot(baseDir: string) {
if (baseDir.startsWith('content://')) { if (baseDir.startsWith('content://')) {
const result = await this.list(baseDir); const result = await this.list(baseDir);
for (const item of result.items) { for (const item of result.items) {
@ -234,5 +240,3 @@ class FileApiDriverLocal {
} }
} }
} }
module.exports = { FileApiDriverLocal };

View File

@ -1,4 +1,4 @@
import Logger from '@joplin/utils/Logger'; import Logger, { LoggerWrapper } from '@joplin/utils/Logger';
import shim from './shim'; import shim from './shim';
import BaseItem from './models/BaseItem'; import BaseItem from './models/BaseItem';
import time from './time'; import time from './time';
@ -100,6 +100,36 @@ async function tryAndRepeat(fn: Function, count: number) {
} }
} }
export interface DeltaOptions {
allItemIdsHandler(): Promise<string[]>;
logger?: LoggerWrapper;
wipeOutFailSafe: boolean;
}
export enum GetOptionsTarget {
String = 'string',
File = 'file',
}
export interface GetOptions {
target?: GetOptionsTarget;
path?: string;
encoding?: string;
source?: string;
}
export interface PutOptions {
path?: string;
source?: string;
}
export interface ItemStat {
path: string;
updated_time: number;
isDir: boolean;
}
class FileApi { class FileApi {
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
@ -316,7 +346,7 @@ class FileApi {
return tryAndRepeat(() => this.driver_.mkdir(this.fullPath(path)), this.requestRepeatCount()); return tryAndRepeat(() => this.driver_.mkdir(this.fullPath(path)), this.requestRepeatCount());
} }
public async stat(path: string) { public async stat(path: string): Promise<ItemStat> {
logger.debug(`stat ${this.fullPath(path)}`); logger.debug(`stat ${this.fullPath(path)}`);
const output = await tryAndRepeat(() => this.driver_.stat(this.fullPath(path)), this.requestRepeatCount()); const output = await tryAndRepeat(() => this.driver_.stat(this.fullPath(path)), this.requestRepeatCount());
@ -327,8 +357,7 @@ class FileApi {
} }
// Returns UTF-8 encoded string by default, or a Response if `options.target = 'file'` // Returns UTF-8 encoded string by default, or a Response if `options.target = 'file'`
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied public get(path: string, options: GetOptions = null) {
public get(path: string, options: any = null) {
if (!options) options = {}; if (!options) options = {};
if (!options.encoding) options.encoding = 'utf8'; if (!options.encoding) options.encoding = 'utf8';
logger.debug(`get ${this.fullPath(path)}`); logger.debug(`get ${this.fullPath(path)}`);
@ -336,7 +365,7 @@ class FileApi {
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
public async put(path: string, content: any, options: any = null) { public async put(path: string, content: any, options: PutOptions = null) {
logger.debug(`put ${this.fullPath(path)}`, options); logger.debug(`put ${this.fullPath(path)}`, options);
if (options && options.source === 'file') { if (options && options.source === 'file') {
@ -372,8 +401,7 @@ class FileApi {
return tryAndRepeat(() => this.driver_.clearRoot(this.baseDir()), this.requestRepeatCount()); return tryAndRepeat(() => this.driver_.clearRoot(this.baseDir()), this.requestRepeatCount());
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied public delta(path: string, options: DeltaOptions|null = null): Promise<PaginatedList> {
public delta(path: string, options: any = null): Promise<PaginatedList> {
logger.debug(`delta ${this.fullPath(path)}`); logger.debug(`delta ${this.fullPath(path)}`);
return tryAndRepeat(() => this.driver_.delta(this.fullPath(path), options), this.requestRepeatCount()); return tryAndRepeat(() => this.driver_.delta(this.fullPath(path), options), this.requestRepeatCount());
} }
@ -423,7 +451,7 @@ function basicDeltaContextFromOptions_(options: any) {
// a built-in delta API. OneDrive and Dropbox have one for example, but Nextcloud and obviously // a built-in delta API. OneDrive and Dropbox have one for example, but Nextcloud and obviously
// the file system do not. // the file system do not.
// eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/no-explicit-any -- Old code before rule was applied, Old code before rule was applied // eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/no-explicit-any -- Old code before rule was applied, Old code before rule was applied
async function basicDelta(path: string, getDirStatFn: Function, options: any) { async function basicDelta(path: string, getDirStatFn: Function, options: DeltaOptions) {
const outputLimit = 50; const outputLimit = 50;
const itemIds = await options.allItemIdsHandler(); const itemIds = await options.allItemIdsHandler();
if (!Array.isArray(itemIds)) throw new Error('Delta API not supported - local IDs must be provided'); if (!Array.isArray(itemIds)) throw new Error('Delta API not supported - local IDs must be provided');

View File

@ -84,6 +84,10 @@ export default class FsDriverBase {
throw new Error('Not implemented: remove'); throw new Error('Not implemented: remove');
} }
public async setTimestamp(_path: string, _timestampDate: Date): Promise<void> {
throw new Error('Not implemented: setTimestamp');
}
public async isDirectory(path: string) { public async isDirectory(path: string) {
const stat = await this.stat(path); const stat = await this.stat(path);
return !stat ? false : stat.isDirectory(); return !stat ? false : stat.isDirectory();

View File

@ -375,6 +375,7 @@ describe('Synchronizer.resources', () => {
const resource: ResourceEntity = (await Resource.all())[0]; const resource: ResourceEntity = (await Resource.all())[0];
const resourcePath = `.resource/${resource.id}`; const resourcePath = `.resource/${resource.id}`;
await synchronizer().api().mkdir('.resource/');
await synchronizer().api().put(resourcePath, 'before upload'); await synchronizer().api().put(resourcePath, 'before upload');
expect(await synchronizer().api().get(resourcePath)).toBe('before upload'); expect(await synchronizer().api().get(resourcePath)).toBe('before upload');
await synchronizerStart(); await synchronizerStart();

View File

@ -13,7 +13,7 @@ import { DownloadController } from './downloadController';
import { TextItem } from 'pdfjs-dist/types/src/display/api'; import { TextItem } from 'pdfjs-dist/types/src/display/api';
import replaceUnsupportedCharacters from './utils/replaceUnsupportedCharacters'; import replaceUnsupportedCharacters from './utils/replaceUnsupportedCharacters';
const { FileApiDriverLocal } = require('./file-api-driver-local'); import FileApiDriverLocal from './file-api-driver-local';
const mimeUtils = require('./mime-utils.js').mime; const mimeUtils = require('./mime-utils.js').mime;
const { _ } = require('./locale'); const { _ } = require('./locale');
const http = require('http'); const http = require('http');

View File

@ -1,6 +1,7 @@
import * as React from 'react'; import * as React from 'react';
import { NoteEntity, ResourceEntity } from './services/database/types'; import { NoteEntity, ResourceEntity } from './services/database/types';
import type FsDriverBase from './fs-driver-base'; import type FsDriverBase from './fs-driver-base';
import type FileApiDriverLocal from './file-api-driver-local';
export interface CreateResourceFromPathOptions { export interface CreateResourceFromPathOptions {
resizeLargeImages?: 'always' | 'never' | 'ask'; resizeLargeImages?: 'always' | 'never' | 'ask';
@ -260,8 +261,7 @@ const shim = {
throw new Error('Not implemented: fsDriver'); throw new Error('Not implemented: fsDriver');
}, },
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied FileApiDriverLocal: null as typeof FileApiDriverLocal,
FileApiDriverLocal: null as any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
readLocalFileBase64: (_path: string): any => { readLocalFileBase64: (_path: string): any => {

View File

@ -30,13 +30,13 @@ import MasterKey from '../models/MasterKey';
import BaseItem from '../models/BaseItem'; import BaseItem from '../models/BaseItem';
import { FileApi } from '../file-api'; import { FileApi } from '../file-api';
const FileApiDriverMemory = require('../file-api-driver-memory').default; const FileApiDriverMemory = require('../file-api-driver-memory').default;
const { FileApiDriverLocal } = require('../file-api-driver-local'); import FileApiDriverLocal from '../file-api-driver-local';
const { FileApiDriverWebDav } = require('../file-api-driver-webdav.js'); const { FileApiDriverWebDav } = require('../file-api-driver-webdav.js');
const { FileApiDriverDropbox } = require('../file-api-driver-dropbox.js'); const { FileApiDriverDropbox } = require('../file-api-driver-dropbox.js');
const { FileApiDriverOneDrive } = require('../file-api-driver-onedrive.js'); const { FileApiDriverOneDrive } = require('../file-api-driver-onedrive.js');
import SyncTargetRegistry from '../SyncTargetRegistry'; import SyncTargetRegistry from '../SyncTargetRegistry';
const SyncTargetMemory = require('../SyncTargetMemory.js'); const SyncTargetMemory = require('../SyncTargetMemory.js');
const SyncTargetFilesystem = require('../SyncTargetFilesystem.js'); import SyncTargetFilesystem from '../SyncTargetFilesystem';
const SyncTargetNextcloud = require('../SyncTargetNextcloud.js'); const SyncTargetNextcloud = require('../SyncTargetNextcloud.js');
const SyncTargetDropbox = require('../SyncTargetDropbox.js'); const SyncTargetDropbox = require('../SyncTargetDropbox.js');
const SyncTargetAmazonS3 = require('../SyncTargetAmazonS3.js'); const SyncTargetAmazonS3 = require('../SyncTargetAmazonS3.js');